From: BJ Weschke Date: Tue, 6 Jun 2006 20:34:00 +0000 (+0000) Subject: Don't leak memory. X-Git-Tag: 1.4.0-beta1~1023 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c30abc476a5dce9db03177a8008d20dd0eca79d;p=thirdparty%2Fasterisk.git Don't leak memory. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32696 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_followme.c b/apps/app_followme.c index 96db7de7b3..5e71cc3354 100644 --- a/apps/app_followme.c +++ b/apps/app_followme.c @@ -264,8 +264,7 @@ static struct number *create_followme_number(char *number, int timeout, int numo if (cur) { cur->timeout = timeout; - if (strchr(number, ',')) { - tmp = strchr(number, ','); + if ((tmp = strchr(number, ','))) { *tmp = '\0'; } ast_copy_string(cur->number, number, sizeof(cur->number)); @@ -634,6 +633,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us tmpuser->state = 1; } else { ast_log(LOG_WARNING, "Unable to playback %s.\n", callfromname); + ast_frfree(f); return NULL; } } else { @@ -642,6 +642,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us ast_sched_runq(tmpuser->ochan->sched); else { ast_log(LOG_WARNING, "Unable to playback %s.\n", tpargs->norecordingprompt); + ast_frfree(f); return NULL; } } @@ -709,12 +710,14 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us if (!strcmp(tmpuser->yn, tpargs->takecall)) { if (option_debug) ast_log(LOG_DEBUG, "Match to take the call!\n"); + ast_frfree(f); return tmpuser->ochan; } if (!strcmp(tmpuser->yn, tpargs->nextindp)) { if (option_debug) ast_log(LOG_DEBUG, "Next in dial plan step requested.\n"); *status = 1; + ast_frfree(f); return NULL; }