add-patch: plug a leak handling the '/' command
Plug a leak we have since d6cf873340
(built-in add -p: implement the '/'
("search regex") command, 2019-12-13).
This leak can be triggered with:
$ printf "A\n\nB\n" >file
$ git add file && git commit -m file
$ printf "AA\n\nBB\n" >file
$ printf "s\n/ .\n" >lines
$ git add -p <lines
Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
parent
5861aa84a7
commit
ec9b74b18e
|
@ -1646,6 +1646,7 @@ soft_increment:
|
||||||
err(s, _("No hunk matches the given pattern"));
|
err(s, _("No hunk matches the given pattern"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
regfree(®ex);
|
||||||
hunk_index = i;
|
hunk_index = i;
|
||||||
} else if (s->answer.buf[0] == 's') {
|
} else if (s->answer.buf[0] == 's') {
|
||||||
size_t splittable_into = hunk->splittable_into;
|
size_t splittable_into = hunk->splittable_into;
|
||||||
|
|
Loading…
Reference in New Issue