odb_load_loose_cache: fix strbuf leak
authorJeff King <peff@peff.net>
Thu, 22 Nov 2018 17:53:00 +0000 (12:53 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 24 Nov 2018 02:13:24 +0000 (11:13 +0900)
Commit 3a2e0824 ("object-store: provide helpers for loose_objects_cache",
2018-11-12) moved the cache-loading code from find_short_object_filename(),
but forgot the line that releases the path strbuf.

Reported-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1-file.c
index e53da0b7013bc281f398565ddcc78bbc9a291319..b8efc4fc8ee7c419dca13927f3070965d9a3f19d 100644 (file)
@@ -2169,6 +2169,7 @@ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)
                                    NULL, NULL,
                                    &odb->loose_objects_cache);
        odb->loose_objects_subdir_seen[subdir_nr] = 1;
+       strbuf_release(&buf);
 }
 
 static int check_stream_sha1(git_zstream *stream,