coccinelle: make use of the "type" FREE_AND_NULL() rule
[gitweb.git] / builtin / clean.c
index 142bf668cffe814006fae791f1bdc6b20fe6f366..bff5a07330ea2e7e2609d4fb138ff71b7f527614 100644 (file)
@@ -837,8 +837,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 +850,7 @@ static void interactive_main_loop(void)
                        quit_cmd();
                }
 
-               free(chosen);
-               chosen = NULL;
+               FREE_AND_NULL(chosen);
                break;
        }
 }