summaryrefslogtreecommitdiff
path: root/main/cli.c
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2008-01-10 19:03:04 +0000
committerTerry Wilson <twilson@digium.com>2008-01-10 19:03:04 +0000
commite823e89b5a975a4d6effd57db2ba1e106dff6300 (patch)
tree2c51dcec4fc21efe8017ad5ac75d0147c874c472 /main/cli.c
parent222917317d64ad3ed1ad6f2239b2b4b0987bd71c (diff)
Check pointers before freeing (was getting WARNINGS under MALLOC_DEBUG)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/cli.c b/main/cli.c
index 72cd8152f..8813c6a3f 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -135,7 +135,8 @@ static char *complete_fn(const char *word, int state)
c += (strlen(ast_config_AST_MODULE_DIR) + 1);
if (c)
c = ast_strdup(c);
- free(d);
+ if (d)
+ free(d);
return c;
}