mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 07:47:18 +00:00
Merge pull request #3646 from pks-t/pks/xdiff-fix-from-upstream
xdiff: fix memleak on error case
This commit is contained in:
commit
778fb695ed
@ -633,8 +633,11 @@ int xdl_merge(mmfile_t *orig, mmfile_t *mf1, mmfile_t *mf2,
|
||||
result->ptr = NULL;
|
||||
result->size = 0;
|
||||
|
||||
if (xdl_do_diff(orig, mf1, xpp, &xe1) < 0 ||
|
||||
xdl_do_diff(orig, mf2, xpp, &xe2) < 0) {
|
||||
if (xdl_do_diff(orig, mf1, xpp, &xe1) < 0) {
|
||||
return -1;
|
||||
}
|
||||
if (xdl_do_diff(orig, mf2, xpp, &xe2) < 0) {
|
||||
xdl_free_env(&xe1);
|
||||
return -1;
|
||||
}
|
||||
if (xdl_change_compact(&xe1.xdf1, &xe1.xdf2, xpp->flags) < 0 ||
|
||||
|
Loading…
Reference in New Issue
Block a user