diff mbox series

[10/38] trace-cmd: don't print a NULL string in append_pid_filter()

Message ID 20240605134054.2626953-11-jmarchan@redhat.com (mailing list archive)
State Accepted
Commit 04556ef9db1449e6ddec52c0339d591458b54104
Headers show
Series trace-cmd: fix misc issues found by static analysis | expand

Commit Message

Jerome Marchand June 5, 2024, 1:40 p.m. UTC
In append_pid_filter() a NULL pointer is passed as the argument for a
%s format. Change the error message to what is used in trace-record.c
append_pid_filter.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
---
 tracecmd/trace-read.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index beaf97a8..a5a0e10a 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -482,7 +482,7 @@  static char *append_pid_filter(char *curr_filter, char *pid)
 	if (!curr_filter) {
 		filter = malloc(len);
 		if (!filter)
-			die("Failed to allocate for filter %s", curr_filter);
+			die("Failed to allocate pid filter");
 		sprintf(filter, ".*:" FILTER_FMT, pid, pid, pid);
 	} else {
 		curr_len = strlen(curr_filter);