chiark / gitweb /
Zero out configuration strings when they are freed.
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 14 Mar 2009 19:00:52 +0000 (19:00 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sat, 14 Mar 2009 19:00:52 +0000 (19:00 +0000)
This means that aliased configuration items aren't double-freed.

lib/configuration.c

index 035e814..958ea6c 100644 (file)
@@ -498,6 +498,7 @@ static void free_none(struct config attribute((unused)) *c,
 static void free_string(struct config *c,
                        const struct conf *whoami) {
   xfree(VALUE(c, char *));
+  VALUE(c, char *) = 0;
 }
 
 static void free_stringlist(struct config *c,