Little revert on some CLI stuff
[asterisk/asterisk.git] / cli.c
diff --git a/cli.c b/cli.c
index fa33bcc..e5fc661 100755 (executable)
--- a/cli.c
+++ b/cli.c
@@ -873,7 +873,7 @@ static char *__ast_cli_generator(char *text, char *word, int state, int lock)
                                                if (lock)
                                                        ast_pthread_mutex_unlock(&clilock);
                                                free(dup);
-                                               return res ? res : NULL;
+                                               return res ? strdup(res) : NULL;
                                        }
                                }
                        }