mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Fix potential memory leak with the dialed interfaces list if another memory allocation fails.
(closes issue #11507) Reported by: eliel Patches: global_datastores.c.patch uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -61,6 +61,7 @@ static void *dialed_interface_duplicate(void *data)
|
|||||||
struct ast_dialed_interface *di2 = ast_calloc(1, sizeof(*di2) + strlen(di->interface));
|
struct ast_dialed_interface *di2 = ast_calloc(1, sizeof(*di2) + strlen(di->interface));
|
||||||
if(!di2) {
|
if(!di2) {
|
||||||
AST_LIST_UNLOCK(old_list);
|
AST_LIST_UNLOCK(old_list);
|
||||||
|
dialed_interface_destroy(new_list);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
strcpy(di2->interface, di->interface);
|
strcpy(di2->interface, di->interface);
|
||||||
|
Reference in New Issue
Block a user