mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 20:14:44 +00:00
patch_parse: fix memory leak
This commit is contained in:
parent
24b2182c5a
commit
613381fc14
@ -1014,8 +1014,10 @@ git_patch_parse_ctx *git_patch_parse_ctx_init(
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (content_len) {
|
if (content_len) {
|
||||||
if ((ctx->content = git__malloc(content_len)) == NULL)
|
if ((ctx->content = git__malloc(content_len)) == NULL) {
|
||||||
|
git__free(ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy((char *)ctx->content, content, content_len);
|
memcpy((char *)ctx->content, content, content_len);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user