Skip to content

Commit

Permalink
fix for more minor memory leaks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Pitre authored and spearce committed Oct 17, 2007
1 parent 4049b9c commit c85228e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,10 @@ int main(int argc, char **argv)
free(objects);
free(index_name_buf);
free(keep_name_buf);
if (pack_name == NULL)
free(curr_pack);
if (index_name == NULL)
free(curr_index);

return 0;
}

0 comments on commit c85228e

Please sign in to comment.