From 6681176ce9af60b9fbc2ef15163e1b3d273cfed7 Mon Sep 17 00:00:00 2001 From: Ken Rice Date: Tue, 1 Apr 2014 08:57:15 -0500 Subject: [PATCH] prevent a segfault in mod_basic if someone calls basic from CLI w/ no args --- src/mod/languages/mod_basic/mod_basic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mod/languages/mod_basic/mod_basic.c b/src/mod/languages/mod_basic/mod_basic.c index 89795926c6..4e62d19790 100644 --- a/src/mod/languages/mod_basic/mod_basic.c +++ b/src/mod/languages/mod_basic/mod_basic.c @@ -319,6 +319,7 @@ SWITCH_STANDARD_APP(basic_function) if (zstr(file)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "missing file\n"); + goto DONE; } if (!switch_is_file_path(file)) { @@ -347,7 +348,8 @@ SWITCH_STANDARD_APP(basic_function) } mb_close(&bi); - + +DONE: switch_safe_free(fdup); switch_safe_free(mydata); }