]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix seg in complete del with no arg
authorAnthony Minessale <anthm@freeswitch.org>
Sun, 6 Apr 2014 20:04:51 +0000 (01:04 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sun, 6 Apr 2014 20:05:07 +0000 (01:05 +0500)
src/switch_console.c

index 66c01583e740494c84bf1e32e88d7d07c0a9e1ac..1d6a6945df13636d49a0d087ad00203ab1bab378 100644 (file)
@@ -1881,7 +1881,11 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
                                status = SWITCH_STATUS_SUCCESS;
                        } else if (!strcasecmp(argv[0], "del")) {
                                char *what = argv[1];
-                               if (!strcasecmp(what, "*")) {
+                               if (zstr(what)) {
+                                       switch_safe_free(mystream.data);  
+                                       switch_safe_free(mydata); 
+                                       return SWITCH_STATUS_FALSE;
+                               } else if (!strcasecmp(what, "*")) {
                                        mystream.write_function(&mystream, "delete from complete where hostname='%s'", switch_core_get_hostname());
                                        switch_core_sql_exec(mystream.data);
                                } else {