mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 08:24:34 +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;
|
||||
|
||||
if (content_len) {
|
||||
if ((ctx->content = git__malloc(content_len)) == NULL)
|
||||
if ((ctx->content = git__malloc(content_len)) == NULL) {
|
||||
git__free(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy((char *)ctx->content, content, content_len);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user