From: Mark Spencer Date: Thu, 22 Apr 2004 00:27:48 +0000 (+0000) Subject: Use ast_strdupa instead of strdup in goto (bug #1465) X-Git-Tag: 1.0.0-rc1~698 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e30e0c51357196ffe332ae1351706a031c13dc82;p=thirdparty%2Fasterisk.git Use ast_strdupa instead of strdup in goto (bug #1465) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2735 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/pbx.c b/pbx.c index cdf57e0f6d..abc1de1f0e 100755 --- a/pbx.c +++ b/pbx.c @@ -4373,7 +4373,7 @@ static int pbx_builtin_goto(struct ast_channel *chan, void *data) ast_log(LOG_WARNING, "Goto requires an argument (optional context|optional extension|priority)\n"); return -1; } - s = strdup((void *) data); + s = ast_strdupa((void *) data); stringp=s; context = strsep(&stringp, "|"); exten = strsep(&stringp, "|"); @@ -4393,7 +4393,6 @@ static int pbx_builtin_goto(struct ast_channel *chan, void *data) } if (atoi(pri) < 0) { ast_log(LOG_WARNING, "Priority '%s' must be a number > 0\n", pri); - free(s); return -1; } /* At this point we have a priority and maybe an extension and a context */