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>
Wed, 18 May 2016 16:23:18 +0000 (12:23 -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 3771de5d94b5b7bfcaacf26b0663044cecaac98f..d9e18c1d68f76ac055f3164038d155a5a7561c57 100644 (file)
@@ -87,7 +87,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.026891 seconds and 4 git commands to generate.