Skip to content

Commit 8ed4e96

Browse files
pks-tgitster
authored andcommitted
builtin/fast-export: fix leaking diff options
Before calling `handle_commit()` in a loop, we set `diffopt.no_free` such that its contents aren't getting freed inside of `handle_commit()`. We never unset that flag though, which means that the structure's allocated resources will ultimately leak. Fix this by unsetting the flag after the loop such that we release its resources via `release_revisions()`. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0662f0d commit 8ed4e96

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/fast-export.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,9 +1278,11 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
12781278
revs.diffopt.format_callback = show_filemodify;
12791279
revs.diffopt.format_callback_data = &paths_of_changed_objects;
12801280
revs.diffopt.flags.recursive = 1;
1281+
12811282
revs.diffopt.no_free = 1;
12821283
while ((commit = get_revision(&revs)))
12831284
handle_commit(commit, &revs, &paths_of_changed_objects);
1285+
revs.diffopt.no_free = 0;
12841286

12851287
handle_tags_and_duplicates(&extra_refs);
12861288
handle_tags_and_duplicates(&tag_refs);

0 commit comments

Comments
 (0)