@matheusbsbs / matheus-bagliano / commits / c85228ed8f
Fork 0

fix for more minor memory leaks

Now that some pointers have lost their const attribute, we can free their associated memory when done with them. This is more a correctness issue about the rule for freeing those pointers which isn't completely trivial more than the leak itself which didn't matter as the program is exiting anyway. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Nicolas Pitre committed Oct 16, 2007 at 21:55 UTC c85228ed8f31eb739e19cf8abcff84fad44c1258
1 file changed +4
index-pack.c
+4
@@ -815,6 +815,10 @@ int main(int argc, char **argv)
815 free(objects);
816 free(index_name_buf);
817 free(keep_name_buf);
818 + if (pack_name == NULL)
819 + free(curr_pack);
820 + if (index_name == NULL)
821 + free(curr_index);
822
823 return 0;
824 }