summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/channel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 78c1caf60..7e8d2fa7b 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1427,7 +1427,7 @@ int ast_channel_datastore_inherit(struct ast_channel *from, struct ast_channel *
if (datastore->inheritance > 0) {
datastore2 = ast_datastore_alloc(datastore->info, datastore->uid);
if (datastore2) {
- datastore2->data = datastore->info->duplicate(datastore->data);
+ datastore2->data = datastore->info->duplicate ? datastore->info->duplicate(datastore->data) : NULL;
datastore2->inheritance = datastore->inheritance == DATASTORE_INHERIT_FOREVER ? DATASTORE_INHERIT_FOREVER : datastore->inheritance - 1;
AST_LIST_INSERT_TAIL(&to->datastores, datastore2, entry);
}