mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 20:11:17 +00:00
Fix some more memory leaks in error path
This commit is contained in:
parent
050af8bbe0
commit
c6451624c4
@ -1902,8 +1902,10 @@ static int write_merge_msg(
|
|||||||
entries = git__calloc(heads_len, sizeof(struct merge_msg_entry));
|
entries = git__calloc(heads_len, sizeof(struct merge_msg_entry));
|
||||||
GITERR_CHECK_ALLOC(entries);
|
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;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < heads_len; i++)
|
for (i = 0; i < heads_len; i++)
|
||||||
entries[i].merge_head = heads[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';
|
link_data[size] = '\0';
|
||||||
if (read_len != (ssize_t)size) {
|
if (read_len != (ssize_t)size) {
|
||||||
giterr_set(GITERR_OS, "Failed to read symlink data for '%s'", path);
|
giterr_set(GITERR_OS, "Failed to read symlink data for '%s'", path);
|
||||||
|
git__free(link_data);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user