mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
allow ast_add_extension2 to accept a NULL destructor (bug #4411)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
6
pbx.c
6
pbx.c
@@ -4514,6 +4514,10 @@ static int ext_strncpy(char *dst, const char *src, int len)
|
||||
return count;
|
||||
}
|
||||
|
||||
static void null_datad(void *foo)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* EBUSY - can't lock
|
||||
* EEXIST - extension with the same priority exist and no replace is set
|
||||
@@ -4560,6 +4564,8 @@ int ast_add_extension2(struct ast_context *con,
|
||||
length ++;
|
||||
|
||||
/* Be optimistic: Build the extension structure first */
|
||||
if (datad == NULL)
|
||||
datad = null_datad;
|
||||
tmp = malloc(length);
|
||||
if (tmp) {
|
||||
memset(tmp, 0, length);
|
||||
|
Reference in New Issue
Block a user