common: Avoid double-free

* common/name-value.c (do_nvc_parse): reset to null after ownership
change

--

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
GnuPG-bug-id: 5393
This commit is contained in:
Jakub Jelen 2021-04-12 19:29:21 +02:00 committed by Werner Koch
parent b677e2ec98
commit 4dc4b025d6
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 1 additions and 0 deletions

View File

@ -690,6 +690,7 @@ do_nvc_parse (nvc_t *result, int *errlinep, estream_t stream,
if (raw_value)
{
err = _nvc_add (*result, name, NULL, raw_value, 1);
name = NULL;
if (err)
goto leave;
}