Skip to content

Commit c85228e

Browse files
Nicolas Pitrespearce
authored andcommitted
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 <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 4049b9c commit c85228e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index-pack.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,10 @@ int main(int argc, char **argv)
815815
free(objects);
816816
free(index_name_buf);
817817
free(keep_name_buf);
818+
if (pack_name == NULL)
819+
free(curr_pack);
820+
if (index_name == NULL)
821+
free(curr_index);
818822

819823
return 0;
820824
}

0 commit comments

Comments
 (0)