Skip to content

Commit abcf857

Browse files
Denton-Lgitster
authored andcommitted
range-diff: clear other_arg at end of function
We were leaking memory by not clearing `other_arg` after we were done using it. Clear it after we've finished using it. Note that this isn't strictly necessary since the memory will be reclaimed once the command exits. However, since we are releasing the strbufs, we should also clear `other_arg` for consistency. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f867534 commit abcf857

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/range-diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix)
8484
res = show_range_diff(range1.buf, range2.buf, creation_factor,
8585
simple_color < 1, &diffopt, &other_arg);
8686

87+
argv_array_clear(&other_arg);
8788
strbuf_release(&range1);
8889
strbuf_release(&range2);
8990

0 commit comments

Comments
 (0)