fix a little leak reported by skopii

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9240 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-08-11 17:47:06 +00:00
parent e813797406
commit 9658d82b1c

View File

@ -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) {