Merge branch 'js/commit-graph-parse-leakfix'
authorJunio C Hamano <gitster@pobox.com>
Sun, 19 May 2019 07:45:28 +0000 (16:45 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 19 May 2019 07:45:28 +0000 (16:45 +0900)
Leakfix.

* js/commit-graph-parse-leakfix:
commit-graph: fix memory leak

commit-graph.c
index 7bcc9bb7e0f9965a2ab3176c0416943430c6a6aa..7c5e54875fdacdf77235a077c9928f7d3bf0d001 100644 (file)
@@ -267,8 +267,10 @@ struct commit_graph *parse_commit_graph(void *graph_map, int fd,
                last_chunk_offset = chunk_offset;
        }
 
-       if (verify_commit_graph_lite(graph))
+       if (verify_commit_graph_lite(graph)) {
+               free(graph);
                return NULL;
+       }
 
        return graph;
 }