shithub: mc

Download patch

ref: 3e622c8ee2d7aac48da5e8614b88aaa4ea550aae
parent: f4d54a5bc70ba219402c1b20a16423bce1704ed9
author: Ori Bernstein <[email protected]>
date: Tue Jun 5 21:11:13 EDT 2012

Don't double-free lists.

    We forgot to set the value to null. Now we do, and free() is a nop

--- a/parse/util.c
+++ b/parse/util.c
@@ -109,8 +109,9 @@
 {
     void ***pl;
 
-    assert(l != NULL);
     pl = l;
+    assert(pl != NULL);
     free(*pl);
+    *pl = NULL;
     *len = 0;
 }