trace-cmd: Fix plist allocation check in trace-msg.c
PATCH 1/1 trace-cmd: Fix plist allocation check in trace-msg.c
From: "Steven Rostedt (VMware)" <[email protected]>
The plist allocation check in get_trace_req_protos() returns error on a successful allocation. Fix it.
Signed-off-by Steven Rostedt (VMware) <[email protected]>
--- lib/trace-cmd/trace-msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/trace-cmd/trace-msg.c +1 -1
@@ -981,7 +981,7 @@ static int get_trace_req_protos(char *buf, int length, } plist =calloc (1 ,sizeof (struct tracecmd_tsync_protos )); -if (plist) +if (!plist) goto error; plist->names =calloc (count +1 ,sizeof (char *));if (!plist->names)
Signature · 1 line
2.25.4