]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Avoid fflush-ing NULL. Found by Klockwork (www.klocwork.com)
authorMichael Jerris <mike@jerris.com>
Thu, 15 May 2008 21:31:47 +0000 (21:31 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 15 May 2008 21:31:47 +0000 (21:31 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8424 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_log.c

index e5cdb4bdcdc8c643f8721eb5fe1fb2cb2938ae8b..b3fa0f6b00173b5328f933b41184241a98dcdda6 100644 (file)
@@ -311,7 +311,9 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char
 
        switch_safe_free(data);
        switch_safe_free(new_fmt);
-       fflush(handle);
+       if (handle) {
+               fflush(handle);
+       }
 }
 
 SWITCH_DECLARE(switch_status_t) switch_log_init(switch_memory_pool_t *pool)