]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix a little leak reported by skopii
authorMichael Jerris <mike@jerris.com>
Mon, 11 Aug 2008 17:47:06 +0000 (17:47 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 11 Aug 2008 17:47:06 +0000 (17:47 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9240 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_console.c

index 211afeb34ef13d5dd6f88aa5bb3d841eae234b1f..259488fd2a9ce55c750377ad3e6e186f9f98f4b7 100644 (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) {