commit | 613381fc1461514fdbb1518799bcee0345fdece6 | [log] [tgz] |
---|---|---|
author | Patrick Steinhardt <ps@pks.im> | Tue Nov 15 13:33:05 2016 +0100 |
committer | Patrick Steinhardt <ps@pks.im> | Tue Nov 15 13:33:05 2016 +0100 |
tree | e190f3086888ee63bdca221042ab798972891ab9 | |
parent | 24b2182c5a77945bedbc5de0f1b4a9b6f5d27284 [diff] |
patch_parse: fix memory leak
diff --git a/src/patch_parse.c b/src/patch_parse.c index 7a4fe9f..f527594 100644 --- a/src/patch_parse.c +++ b/src/patch_parse.c
@@ -1014,8 +1014,10 @@ 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); }