From: Kevin P. Fleming Date: Fri, 3 Jun 2005 02:21:07 +0000 (+0000) Subject: allow ast_add_extension2 to accept a NULL destructor (bug #4411) X-Git-Tag: 1.2.0-beta1~540 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db402ee5d68b11630e9e68f0ee5564217f7ae1b0;p=thirdparty%2Fasterisk.git 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 --- diff --git a/pbx.c b/pbx.c index e64509ed4d..02b22edf37 100755 --- a/pbx.c +++ b/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);