better zero out allocated memory
authorPhil Sutter <phil@nwl.cc>
Mon, 14 Sep 2009 00:07:45 +0000 (02:07 +0200)
committerPhil Sutter <phil@nwl.cc>
Tue, 15 Sep 2009 21:16:39 +0000 (23:16 +0200)
src/top.c

index ba0602e..ade98ec 100644 (file)
--- a/src/top.c
+++ b/src/top.c
@@ -522,8 +522,7 @@ static struct sorted_process *malloc_sp(struct process *proc)
 {
        struct sorted_process *sp;
        sp = malloc(sizeof(struct sorted_process));
-       sp->greater = NULL;
-       sp->less = NULL;
+       memset(sp, 0, sizeof(struct sorted_process));
        sp->proc = proc;
        return sp;
 }