Description: zeros out reused structures to stop double free problems Bug-Debian: http://bugs.debian.org/550009 Author: Arnaud Giersch --- a/proc/readproc.c +++ b/proc/readproc.c @@ -828,6 +828,7 @@ saved_p = p; if(!p) p = xcalloc(p, sizeof *p); /* passed buf or alloced mem */ + else memset(p, 0, sizeof *p); for(;;){ // fills in the path, plus p->tid and p->tgid @@ -856,6 +857,7 @@ saved_t = t; if(!t) t = xcalloc(t, sizeof *t); /* passed buf or alloced mem */ + else memset(t, 0, sizeof *t); // 1. got to fake a thread for old kernels // 2. for single-threaded processes, this is faster (but must patch up stuff that differs!)