t/helper/test-hashmap: use custom data instead of duplicate cmp functions
[gitweb.git] / refs / files-backend.c
index b040bb3b0a7efd2862249cb2fe4df6c1f94becdb..0404f2c2333c0fadeb57d225deedc6f0d4afadad 100644 (file)
@@ -1,4 +1,5 @@
 #include "../cache.h"
+#include "../config.h"
 #include "../refs.h"
 #include "refs-internal.h"
 #include "ref-cache.h"
@@ -2958,8 +2959,7 @@ static int files_transaction_prepare(struct ref_store *ref_store,
                                       head_oid.hash, &head_type);
 
        if (head_ref && !(head_type & REF_ISSYMREF)) {
-               free(head_ref);
-               head_ref = NULL;
+               FREE_AND_NULL(head_ref);
        }
 
        /*