diff options
author | Patrick Steinhardt <ps@pks.im> | 2018-02-09 17:31:50 +0000 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-02-09 17:31:50 +0000 |
commit | a43bcd2c5392586f987d0c3c6247e75699ba135d (patch) | |
tree | 1acc28178fc65affda99e02d86b4d574c87afab3 | |
parent | 028a28066ff3aaf79767e9a5c5cc5ff6762cc4bc (diff) | |
download | libgit2-a43bcd2c5392586f987d0c3c6247e75699ba135d.tar.gz |
odb: fix memory leaks due to not freeing hash context
-rw-r--r-- | src/odb.c | 2 | ||||
-rw-r--r-- | src/odb_loose.c | 1 |
2 files changed, 3 insertions, 0 deletions
@@ -1373,6 +1373,8 @@ int git_odb_open_wstream( (*stream)->received_bytes = 0; done: + if (error) + git__free(ctx); return error; } diff --git a/src/odb_loose.c b/src/odb_loose.c index 713288da2..7032b8a71 100644 --- a/src/odb_loose.c +++ b/src/odb_loose.c @@ -1030,6 +1030,7 @@ done: git_futils_mmap_free(&stream->map); git_zstream_free(&stream->zstream); git_hash_ctx_cleanup(hash_ctx); + git__free(hash_ctx); git__free(stream); } |