Fix: Wrong sizeof argument in pid tracker
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 17 May 2016 13:23:50 +0000 (09:23 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 20 May 2016 19:15:12 +0000 (15:15 -0400)
Found by Coverity:

CID 1292557 (#1 of 1): Wrong sizeof argument
(SIZEOF_MISMATCH)suspicious_sizeof: Passing argument 8UL /* sizeof
(*_pid_list) */ to function zmalloc and then casting the return value to
int * is suspicious.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/track-untrack.c

index 1d84ab92760fbd3db0864b130e4ed072f26ff21f..890e1836b66ec952ccfaff17ee39b959978f1aa8 100644 (file)
@@ -110,7 +110,7 @@ int parse_pid_string(const char *_pid_string,
                goto error;
        }
        if (all) {
-               pid_list = zmalloc(sizeof(*_pid_list));
+               pid_list = zmalloc(sizeof(*pid_list));
                if (!pid_list) {
                        ERR("Out of memory");
                        retval = CMD_ERROR;
This page took 0.025324 seconds and 4 git commands to generate.