object.c: free replace map in raw_object_store_clear
[gitweb.git] / object.c
index a0a756f24f33621bbe83cbe69b18eef6790edacf..cdf520084dfd4bd86671114bf7a5425f3fd36783 100644 (file)
--- a/object.c
+++ b/object.c
@@ -1,5 +1,6 @@
 #include "cache.h"
 #include "object.h"
+#include "replace-object.h"
 #include "blob.h"
 #include "tree.h"
 #include "commit.h"
@@ -246,7 +247,7 @@ struct object *parse_object(const struct object_id *oid)
        unsigned long size;
        enum object_type type;
        int eaten;
-       const struct object_id *repl = lookup_replace_object(oid);
+       const struct object_id *repl = lookup_replace_object(the_repository, oid);
        void *buffer;
        struct object *obj;
 
@@ -479,6 +480,7 @@ void raw_object_store_clear(struct raw_object_store *o)
 {
        FREE_AND_NULL(o->objectdir);
        FREE_AND_NULL(o->alternate_db);
+       FREE_AND_NULL(o->replace_map);
 
        free_alt_odbs(o);
        o->alt_odb_tail = NULL;