diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2016-10-21 14:24:13 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-21 09:31:53 -0700 |
commit | 03a4e260e2bf4eebd7ea6658d24507fbf80f3ecd (patch) | |
tree | c6be96927cc799ac349aec109ea992966b9cb9b2 /sequencer.h | |
parent | 285abf561aa410b3a9dfb2887e42fcdc4c461971 (diff) | |
download | git-03a4e260e2bf4eebd7ea6658d24507fbf80f3ecd.tar.gz |
sequencer: plug memory leaks for the option values
The sequencer is our attempt to lib-ify cherry-pick. Yet it behaves
like a one-shot command when it reads its configuration: memory is
allocated and released only when the command exits.
This is kind of okay for git-cherry-pick, which *is* a one-shot
command. All the work to make the sequencer its work horse was
done to allow using the functionality as a library function, though,
including proper clean-up after use.
To remedy that, take custody of the option values in question,
allocating and duping literal constants as needed and freeing them
at end.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.h')
-rw-r--r-- | sequencer.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sequencer.h b/sequencer.h index dd4d33a572..8453669765 100644 --- a/sequencer.h +++ b/sequencer.h @@ -34,11 +34,11 @@ struct replay_opts { int mainline; - const char *gpg_sign; + char *gpg_sign; /* Merge strategy */ - const char *strategy; - const char **xopts; + char *strategy; + char **xopts; size_t xopts_nr, xopts_alloc; /* Only used by REPLAY_NONE */ |