From 0e391f7d40c40fd5a90c99454a191d63991a8f69 Mon Sep 17 00:00:00 2001
From: Hongjia Cao <hjcao@nudt.edu.cn>
Date: Fri, 12 Apr 2013 08:09:06 -0700
Subject: [PATCH] fix test condition of log_fp() to avoid segfault

---
 src/common/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/log.c b/src/common/log.c
index e8fe7a8f0de..5a433f80a12 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -583,7 +583,7 @@ FILE *log_fp(void)
 {
 	FILE *fp;
 	slurm_mutex_lock(&log_lock);
-	if (log->logfp)
+	if (log && log->logfp)
 		fp = log->logfp;
 	else
 		fp = stderr;
-- 
GitLab