aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-23 15:17:54 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-23 15:17:54 +0000
commit815070b338e386d79981782aee2f741d1948e6c0 (patch)
tree084c3dfad4e97f591d46bdc1489e33706227d44b
parent93c311127bd2a5d6fa986e209e570f1cd217f8d5 (diff)
Merged revisions 166568 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r166568 | mmichelson | 2008-12-23 09:16:26 -0600 (Tue, 23 Dec 2008) | 12 lines Fix a crash resulting from a datastore with inheritance but no duplicate callback The fix for this is to simply set the newly created datastore's data pointer to NULL if it is inherited but has no duplicate callback. (closes issue #14113) Reported by: francesco_r Patches: 14113.patch uploaded by putnopvut (license 60) Tested by: francesco_r ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@166569 f38db490-d61c-443f-a65b-d21fe96a405b
-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);
}