Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-10-17 05:55:50 +0400
committerShawn O. Pearce <spearce@spearce.org>2007-10-17 10:54:57 +0400
commitc85228ed8f31eb739e19cf8abcff84fad44c1258 (patch)
tree65c2db65836dc63cf047e2dcd192cd7daf93b0f7
parent4049b9cfc082affc6365539138f6f5c546bb5685 (diff)
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>
-rw-r--r--index-pack.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/index-pack.c b/index-pack.c
index 60173d5192..2f149a40fd 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -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;
}