[PATCH 26/38] trace-cmd record: don't print a NULL string in get_temp_file()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In get_temp_file() if we fails to allocate a temp file for a top
instance, a NULL pointer is passed as the argument for a %s format in
the error message.

Signed-off-by: Jerome Marchand <jmarchan@xxxxxxxxxx>
---
 tracecmd/trace-record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 2223d5bb..b4cbd438 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -559,7 +559,7 @@ static char *get_temp_file(struct buffer_instance *instance, int cpu)
 		size = snprintf(file, 0, "%s.cpu%d", output_file, cpu);
 		file = malloc(size + 1);
 		if (!file)
-			die("Failed to allocate temp file for %s", name);
+			die("Failed to allocate temp file");
 		sprintf(file, "%s.cpu%d", output_file, cpu);
 	}
 
-- 
2.44.0





[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux