Merge branch 'st/lib-gpg-kill-stray-agent'
[gitweb.git] / tree-diff.c
index 7f7ddda4ea51e32f67ded46d73f5c0b1c8adb6d6..2357f72899f8f47e497ffd1bb66a0d76d7dbe012 100644 (file)
@@ -141,8 +141,7 @@ static struct combine_diff_path *path_appendnew(struct combine_diff_path *last,
        /* if last->next is !NULL - it is a pre-allocated memory, we can reuse */
        p = last->next;
        if (p && (alloclen > (intptr_t)p->next)) {
-               free(p);
-               p = NULL;
+               FREE_AND_NULL(p);
        }
 
        if (!p) {
@@ -560,8 +559,7 @@ struct combine_diff_path *diff_tree_paths(
         * (see path_appendnew() for details about why)
         */
        if (p->next) {
-               free(p->next);
-               p->next = NULL;
+               FREE_AND_NULL(p->next);
        }
 
        return p;