From 772405499e3c3d99865f6cc371727cd75fc71cc7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 2 Jul 2010 13:15:56 -0700 Subject: Fix null reference in command logging When doing command completion, the sub-process is not a command so it has no information, therefore don't log it. --- logging.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/logging.c b/logging.c index 93838b5..f21d2a7 100644 --- a/logging.c +++ b/logging.c @@ -74,7 +74,10 @@ void log_process_exit (child) size_t cc; struct command_log *lrec; - if (message_queue == (mqd_t) -1) + if (message_queue == (mqd_t) -1) /* message queue does not exist */ + return; + + if (child->command == NULL) /* no command info */ return; cc = sizeof(*lrec) + strlen(child->command) + 1; -- cgit v1.2.3