diff options
author | Rémi Duraffort <ivoire@videolan.org> | 2013-07-15 16:00:07 +0200 |
---|---|---|
committer | Rémi Duraffort <ivoire@videolan.org> | 2013-07-15 16:29:18 +0200 |
commit | c6451624c4631ccf039d0f3d5af6fbf4364f001c (patch) | |
tree | 1f04e39cdad62d509267b7ed144bd583d618b320 /src | |
parent | 050af8bbe08b7cab7bfce044dcb51fb61ff1dc41 (diff) | |
download | libgit2-c6451624c4631ccf039d0f3d5af6fbf4364f001c.tar.gz |
Fix some more memory leaks in error path
Diffstat (limited to 'src')
-rw-r--r-- | src/merge.c | 4 | ||||
-rw-r--r-- | src/odb.c | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/merge.c b/src/merge.c index 82d2e6f37..2e94ce1cd 100644 --- a/src/merge.c +++ b/src/merge.c @@ -1902,8 +1902,10 @@ static int write_merge_msg( entries = git__calloc(heads_len, sizeof(struct merge_msg_entry)); GITERR_CHECK_ALLOC(entries); - if (git_vector_init(&matching, heads_len, NULL) < 0) + if (git_vector_init(&matching, heads_len, NULL) < 0) { + git__free(entries); return -1; + } for (i = 0; i < heads_len; i++) entries[i].merge_head = heads[i]; @@ -232,6 +232,7 @@ int git_odb__hashlink(git_oid *out, const char *path) link_data[size] = '\0'; if (read_len != (ssize_t)size) { giterr_set(GITERR_OS, "Failed to read symlink data for '%s'", path); + git__free(link_data); return -1; } |