summaryrefslogtreecommitdiff
path: root/main/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/cli.c b/main/cli.c
index c54d89e87..d901e5c83 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -2360,8 +2360,10 @@ char **ast_cli_completion_matches(const char *text, const char *word)
/* ensure that the array is NULL terminated */
if (matches + 1 >= match_list_len) {
- if (!(match_list = ast_realloc(match_list, (match_list_len + 1) * sizeof(*match_list))))
+ if (!(match_list = ast_realloc(match_list, (match_list_len + 1) * sizeof(*match_list)))) {
+ ast_free(retstr);
return NULL;
+ }
}
match_list[matches + 1] = NULL;