diff --git a/fish/destpaths.c b/fish/destpaths.c index 9c97bf0b2..f2241069b 100644 --- a/fish/destpaths.c +++ b/fish/destpaths.c @@ -154,7 +154,8 @@ complete_dest_paths_generator (const char *text, int state) /* If we've got a partial path already, we need to list everything * in that directory, otherwise list everything in / */ - char *p, *dir; + CLEANUP_FREE char *dir = NULL; + char *p; struct guestfs_dirent_list *dirents; p = strrchr (text, '/');