Skip to content

Commit d1ec656

Browse files
avargitster
authored andcommitted
cherry-pick: free "struct replay_opts" members
Call the release_revisions() function added in 1878b5e (revision.[ch]: provide and start using a release_revisions(), 2022-04-13) in cmd_cherry_pick(), as well as freeing the xmalloc()'d "revs" member itself. This is the same change as the one made for cmd_revert() a few lines above it in fd74ac9 (revert: free "struct replay_opts" members, 2022-07-01). Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 5ff6e8a commit d1ec656

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

builtin/revert.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ int cmd_cherry_pick(int argc, const char **argv, const char *prefix)
261261
opts.action = REPLAY_PICK;
262262
sequencer_init_config(&opts);
263263
res = run_sequencer(argc, argv, &opts);
264+
if (opts.revs)
265+
release_revisions(opts.revs);
266+
free(opts.revs);
264267
if (res < 0)
265268
die(_("cherry-pick failed"));
266269
return res;

0 commit comments

Comments
 (0)