mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-30 16:17:02 +01:00
tests: avoid use of freed pointer
[spotted by coverity] This is only in tests/, but easy to fix, so... I've included extra context so you can see how var->value would be used in the following atoi call. >From cf9ae83fd2da8d7a289b048ef0feed4096f6d263 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 20 Sep 2011 16:32:59 +0200 Subject: [PATCH] avoid use of free'd pointer * asschk.c (set_type_var): Set var->value to NULL after freeing it, to avoid subsequent use of freed pointer.
This commit is contained in:
parent
b8b4d5c9e5
commit
850f09b2e3
@ -1,3 +1,9 @@
|
|||||||
|
2011-09-20 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
|
avoid use of free'd pointer
|
||||||
|
* asschk.c (set_type_var): Set var->value to NULL after freeing it,
|
||||||
|
to avoid subsequent use of freed pointer.
|
||||||
|
|
||||||
2009-10-13 Werner Koch <wk@g10code.com>
|
2009-10-13 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* asschk.c (die): Replace this vararg macro by C-89 compliant
|
* asschk.c (die): Replace this vararg macro by C-89 compliant
|
||||||
|
@ -514,7 +514,10 @@ set_type_var (const char *name, const char *value, VARTYPE type)
|
|||||||
variable_list = var;
|
variable_list = var;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
free (var->value);
|
{
|
||||||
|
free (var->value);
|
||||||
|
var->value = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (var->type == VARTYPE_FD && var->value)
|
if (var->type == VARTYPE_FD && var->value)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user