From: Mark Spencer Date: Fri, 22 Aug 2003 05:30:58 +0000 (+0000) Subject: Fix memory leak X-Git-Tag: 0.5.0~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2421bea611bd5efe8fc624673f896069094f91af;p=thirdparty%2Fasterisk.git Fix memory leak git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1403 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 114defd612..cd3c4a5478 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -5189,7 +5189,7 @@ static struct ast_channel *zt_request(char *type, int format, void *data) return NULL; } if (data) { - dest = strdup((char *)data); + dest = strdupa((char *)data); } else { ast_log(LOG_WARNING, "Channel requested with no data\n"); return NULL; @@ -5201,7 +5201,6 @@ static struct ast_channel *zt_request(char *type, int format, void *data) s = strsep(&stringp, "/"); if ((res = sscanf(s, "%d%c%d", &x, &opt, &y)) < 1) { ast_log(LOG_WARNING, "Unable to determine group for data %s\n", (char *)data); - free(dest); return NULL; } groupmatch = 1 << x; @@ -5216,7 +5215,6 @@ static struct ast_channel *zt_request(char *type, int format, void *data) x = CHAN_PSEUDO; } else if ((res = sscanf(s, "%d%c%d", &x, &opt, &y)) < 1) { ast_log(LOG_WARNING, "Unable to determine channel for data %s\n", (char *)data); - free(dest); return NULL; } channelmatch = x;