builtin/fsck: convert remaining caller of get_sha1 to object_id
[gitweb.git] / builtin / clean.c
index 142bf668cffe814006fae791f1bdc6b20fe6f366..057fc97fe4494338e6a85ac9f695563f1fcb9596 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "builtin.h"
 #include "cache.h"
+#include "config.h"
 #include "dir.h"
 #include "parse-options.h"
 #include "string-list.h"
@@ -837,8 +838,7 @@ static void interactive_main_loop(void)
                        int ret;
                        ret = menus[*chosen].fn();
                        if (ret != MENU_RETURN_NO_LOOP) {
-                               free(chosen);
-                               chosen = NULL;
+                               FREE_AND_NULL(chosen);
                                if (!del_list.nr) {
                                        clean_print_color(CLEAN_COLOR_ERROR);
                                        printf_ln(_("No more files to clean, exiting."));
@@ -851,8 +851,7 @@ static void interactive_main_loop(void)
                        quit_cmd();
                }
 
-               free(chosen);
-               chosen = NULL;
+               FREE_AND_NULL(chosen);
                break;
        }
 }