run-command: add hint when a hook is ignored
[gitweb.git] / diff-lib.c
index 0c0e20f7c004119cd86bc377722eca6d318cdf5d..4e0980caa80fb980938f68c8d350ec00cc24398b 100644 (file)
@@ -179,8 +179,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
                                free(dpath);
                                continue;
                        }
-                       free(dpath);
-                       dpath = NULL;
+                       FREE_AND_NULL(dpath);
 
                        /*
                         * Show the diff for the 'ce' if we found the one
@@ -550,7 +549,6 @@ int index_differs_from(const char *def, int diff_flags,
        rev.diffopt.flags |= diff_flags;
        rev.diffopt.ita_invisible_in_index = ita_invisible_in_index;
        run_diff_index(&rev, 1);
-       if (rev.pending.alloc)
-               free(rev.pending.objects);
+       object_array_clear(&rev.pending);
        return (DIFF_OPT_TST(&rev.diffopt, HAS_CHANGES) != 0);
 }