diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-05-23 23:39:54 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-23 23:39:54 +0200 |
commit | 1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e (patch) | |
tree | ea4841ac780e199292b086cb8d1322f2b5bbc6be /object-file.c | |
parent | Merge branch 'ab/commit-plug-leaks' (diff) | |
parent | commit-graph.c: don't assume that stat() succeeds (diff) | |
download | git-1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e.tar.xz git-1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e.zip |
Merge branch 'ab/valgrind-fixes'
A bit of test framework fixes with a few fixes to issues found by
valgrind.
* ab/valgrind-fixes:
commit-graph.c: don't assume that stat() succeeds
object-file: fix a unpack_loose_header() regression in 3b6a8db3b03
log test: skip a failing mkstemp() test under valgrind
tests: using custom GIT_EXEC_PATH breaks --valgrind tests
Diffstat (limited to 'object-file.c')
-rw-r--r-- | object-file.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/object-file.c b/object-file.c index a81d84132d..d35c1820e7 100644 --- a/object-file.c +++ b/object-file.c @@ -2623,8 +2623,12 @@ int read_loose_object(const char *path, goto out; } - if (unpack_loose_header(&stream, map, mapsize, hdr, sizeof(hdr), - NULL) < 0) { + switch (unpack_loose_header(&stream, map, mapsize, hdr, sizeof(hdr), + NULL)) { + case ULHR_OK: + break; + case ULHR_BAD: + case ULHR_TOO_LONG: error(_("unable to unpack header of %s"), path); goto out; } |