From 73f4184b7bc72d6524ab3be83fe1fcf223253158 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 29 Apr 2010 15:32:54 +0000 Subject: [PATCH] Unset sSyslogBuffer in all error cases in which we disable syslog output. Spotted by Axel. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36532 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/debug/debug.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/debug/debug.cpp b/src/system/kernel/debug/debug.cpp index f780668375..67110ff918 100644 --- a/src/system/kernel/debug/debug.cpp +++ b/src/system/kernel/debug/debug.cpp @@ -1306,6 +1306,8 @@ syslog_init_post_threads(void) delete_area(area_for(sSyslogBuffer)); else delete_ring_buffer(sSyslogBuffer); + + sSyslogBuffer = NULL; } free(sSyslogMessage); @@ -1364,7 +1366,6 @@ syslog_init_post_vm(struct kernel_args* args) area_id area = create_area("syslog debug", &base, B_EXACT_ADDRESS, size, B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA); if (area < 0) { - sSyslogBuffer = NULL; status = B_NO_MEMORY; goto err2; } @@ -1402,6 +1403,7 @@ err2: free(sSyslogMessage); err1: sSyslogOutputEnabled = false; + sSyslogBuffer = NULL; return status; }