From ed1e52822ea4a8493855d9b8be1049d561946137 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 22 Dec 2017 12:50:50 +0100 Subject: sequencer: assign only free()able strings to gpg_sign The gpg_sign member of the replay_opts structure is of type `char *`, meaning that the sequencer deems the string to which gpg_sign points to be under its custody, i.e. it needs to be free()d by the sequencer. Therefore, let's only assign malloc()ed buffers to it. Reported-by: Kaartic Sivaraam Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sequencer.c') diff --git a/sequencer.c b/sequencer.c index 7051b20b76..1b2599668f 100644 --- a/sequencer.c +++ b/sequencer.c @@ -160,7 +160,7 @@ static int git_sequencer_config(const char *k, const char *v, void *cb) } if (!strcmp(k, "commit.gpgsign")) { - opts->gpg_sign = git_config_bool(k, v) ? "" : NULL; + opts->gpg_sign = git_config_bool(k, v) ? xstrdup("") : NULL; return 0; } -- cgit v1.2.1