mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-27 08:54:47 +00:00
transports: smart: fix memory leak on OOM path
This commit is contained in:
parent
038d7af085
commit
704554cdf0
@ -108,6 +108,7 @@ static int append_symref(const char **out, git_vector *symrefs, const char *ptr)
|
|||||||
if (giterr_last()->klass != GITERR_NOMEMORY)
|
if (giterr_last()->klass != GITERR_NOMEMORY)
|
||||||
goto on_invalid;
|
goto on_invalid;
|
||||||
|
|
||||||
|
git__free(mapping);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,6 +121,7 @@ static int append_symref(const char **out, git_vector *symrefs, const char *ptr)
|
|||||||
on_invalid:
|
on_invalid:
|
||||||
giterr_set(GITERR_NET, "remote sent invalid symref");
|
giterr_set(GITERR_NET, "remote sent invalid symref");
|
||||||
git_refspec__free(mapping);
|
git_refspec__free(mapping);
|
||||||
|
git__free(mapping);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user