mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
common: Fix memory leaks.
* common/name-value.c (do_nvc_parse): Free NAME. * common/recsel.c (recsel_parse_expr): Release SE_HEAD and EXPR_BUFFER. -- GnuPG-bug-id: 5393 Signed-off-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
parent
51bbd99a3c
commit
a16f726f94
@ -777,9 +777,13 @@ do_nvc_parse (nvc_t *result, int *errlinep, estream_t stream,
|
||||
|
||||
/* Add the final entry. */
|
||||
if (raw_value)
|
||||
err = _nvc_add (*result, name, NULL, raw_value, 1);
|
||||
{
|
||||
err = _nvc_add (*result, name, NULL, raw_value, 1);
|
||||
name = NULL;
|
||||
}
|
||||
|
||||
leave:
|
||||
xfree (name);
|
||||
gpgrt_free (buf);
|
||||
if (err)
|
||||
{
|
||||
|
@ -249,7 +249,13 @@ recsel_parse_expr (recsel_expr_t *selector, const char *expression)
|
||||
|
||||
se = xtrymalloc (sizeof *se + strlen (expr));
|
||||
if (!se)
|
||||
return my_error_from_syserror ();
|
||||
{
|
||||
gpg_error_t err = my_error_from_syserror ();
|
||||
|
||||
recsel_release (se_head);
|
||||
xfree (expr_buffer);
|
||||
return err;
|
||||
}
|
||||
strcpy (se->name, expr);
|
||||
se->next = NULL;
|
||||
se->not = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user