Merge branch 'rs/find-pack-entry-bisection' into next
[gitweb.git] / refs / files-backend.c
index f2a420c6118fb2bf4e3514ea544fae17896e51d6..5cca55510b6a0683f16937215f6056d896c622e0 100644 (file)
@@ -1,4 +1,5 @@
 #include "../cache.h"
+#include "../config.h"
 #include "../refs.h"
 #include "refs-internal.h"
 #include "ref-cache.h"
@@ -2464,8 +2465,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);
        }
 
        /*