From: Michael Jerris Date: Mon, 11 Aug 2008 17:47:06 +0000 (+0000) Subject: fix a little leak reported by skopii X-Git-Tag: v1.0.2~1495 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9658d82b1c1c01c76e045341c8bbe1157c152f48;p=thirdparty%2Ffreeswitch.git fix a little leak reported by skopii git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9240 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_console.c b/src/switch_console.c index 211afeb34e..259488fd2a 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -165,7 +165,7 @@ char *expand_alias(char *cmd, char *arg) { char *errmsg = NULL; char *r = NULL; - char *sql; + char *sql = NULL; char *exp = NULL; switch_core_db_t *db = switch_core_db_handle(); int full = 0; @@ -179,6 +179,8 @@ char *expand_alias(char *cmd, char *arg) free(errmsg); } + switch_safe_free(sql); + if (!r) { sql = switch_mprintf("select command from aliases where alias='%q %q'", cmd, arg); @@ -193,6 +195,7 @@ char *expand_alias(char *cmd, char *arg) } } + switch_safe_free(sql); if (r) { if (arg && !full) {