]> granicus.if.org Git - procps-ng/commitdiff
library: with valgrind help, fix faulty meminfo assign
authorJim Warner <james.warner@comcast.net>
Tue, 8 Sep 2015 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Mon, 21 Sep 2015 12:35:05 +0000 (22:35 +1000)
Not sure how this one has gone unnoticed until now but
with valgrind's help it's going bye-bye lickety-split.

Reference(s):
==26533== Conditional jump or move depends on uninitialised value(s)
==26533==    at 0x4E4082B: procps_meminfo_stack_fill (meminfo.c:408)

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/meminfo.c

index a3a1060d09b54dbbdc67e9d60d536614b6520e86..44dbc88b04f0e54c865d7a2140f538b4526039c6 100644 (file)
@@ -405,7 +405,7 @@ PROCPS_EXPORT int procps_meminfo_stack_fill (
 
     if (info == NULL || stack == NULL || stack->head == NULL)
         return -EINVAL;
-    if ((rc == procps_meminfo_read(info)) < 0)
+    if ((rc = procps_meminfo_read(info)) < 0)
         return rc;
 
     return procps_meminfo_getstack(info, stack->head);