]> git.ipfire.org Git - thirdparty/git.git/commit
gpg-interface: refactor the free-and-xmemdupz pattern
authorHans Jerry Illikainen <hji@dyntopia.com>
Thu, 21 Nov 2019 23:43:35 +0000 (23:43 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 23 Nov 2019 00:09:32 +0000 (09:09 +0900)
commit392b862e9aea69acf43532527e27644c97e3ea56
tree1a76d1e2b6aa65b1e3f35f60b21a5dc7860c7ea2
parent75b2f01a0f642b39b0f29b6218515df9b5eb798e
gpg-interface: refactor the free-and-xmemdupz pattern

Introduce a static replace_cstring() function to simplify repeated
pattern of free-and-xmemdupz() for GPG status line parsing.

This also helps us avoid potential memleaks if parsing of new status
lines are introduced in the future.

Signed-off-by: Hans Jerry Illikainen <hji@dyntopia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gpg-interface.c