aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ChangeLog6
-rw-r--r--tests/asschk.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index b2e95f323..aa93f0780 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-20 Jim Meyering <[email protected]>
+
+ 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 <[email protected]>
* asschk.c (die): Replace this vararg macro by C-89 compliant
diff --git a/tests/asschk.c b/tests/asschk.c
index 3eb262178..c0108e71d 100644
--- a/tests/asschk.c
+++ b/tests/asschk.c
@@ -514,7 +514,10 @@ set_type_var (const char *name, const char *value, VARTYPE type)
variable_list = var;
}
else
- free (var->value);
+ {
+ free (var->value);
+ var->value = NULL;
+ }
if (var->type == VARTYPE_FD && var->value)
{