diff options
Diffstat (limited to 'main/cli.c')
-rw-r--r-- | main/cli.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/main/cli.c b/main/cli.c index 6c79c7bb2..c54d89e87 100644 --- a/main/cli.c +++ b/main/cli.c @@ -2350,8 +2350,10 @@ char **ast_cli_completion_matches(const char *text, const char *word) max_equal = i; } - if (!(retstr = ast_malloc(max_equal + 1))) + if (!(retstr = ast_malloc(max_equal + 1))) { + ast_free(match_list); return NULL; + } ast_copy_string(retstr, match_list[1], max_equal + 1); match_list[0] = retstr; |