Commit 613381fc by Patrick Steinhardt

patch_parse: fix memory leak

parent 24b2182c
...@@ -1014,8 +1014,10 @@ git_patch_parse_ctx *git_patch_parse_ctx_init( ...@@ -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);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment