Some more memory leak avoidance
[gitweb.git] / builtin-rev-list.c
index 2b298c4e412c4fca24ea5068f17a557f89a6a449..71353eb19db158a60a5ae94f83f53059adc3399b 100644 (file)
@@ -89,6 +89,14 @@ static void show_commit(struct commit *commit)
                printf("%s%c", pretty_header, hdr_termination);
        }
        fflush(stdout);
+       if (commit->parents) {
+               free_commit_list(commit->parents);
+               commit->parents = NULL;
+       }
+       if (commit->buffer) {
+               free(commit->buffer);
+               commit->buffer = NULL;
+       }
 }
 
 static struct object_list **process_blob(struct blob *blob,