From 65fd53434678ddc63abc5e81c6f47d4c3c75616b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 7 Apr 2014 01:04:51 +0500 Subject: [PATCH] fix seg in complete del with no arg --- src/switch_console.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/switch_console.c b/src/switch_console.c index 62252a91ff..828613edbc 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -1880,7 +1880,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 {