summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-02-05 14:14:17 +1100
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-02-05 14:14:17 +1100
commitadd8acf42882a13af610ace6005d52544509a823 (patch)
tree39053875ddf3c30551c212df081122dda409a3e2
parentdb72b509d17311d289b140afb3456376c5525ad7 (diff)
downloadtor-add8acf42882a13af610ace6005d52544509a823.tar.gz
tor-add8acf42882a13af610ace6005d52544509a823.zip
Avoid calling log functions in logv when SMARTLIST_DEBUG is defined
-rw-r--r--src/common/log.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/log.c b/src/common/log.c
index f71583fd63..4779751543 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -490,7 +490,8 @@ logv,(int severity, log_domain_mask_t domain, const char *funcname,
assert(log_mutex_initialized);
LOCK_LOGS();
- if ((! (domain & LD_NOCB)) && smartlist_len(pending_cb_messages))
+ if ((! (domain & LD_NOCB)) && pending_cb_messages
+ && smartlist_len(pending_cb_messages))
flush_pending_log_callbacks();
if (queue_startup_messages &&
@@ -945,7 +946,7 @@ flush_pending_log_callbacks(void)
smartlist_t *messages, *messages_tmp;
LOCK_LOGS();
- if (0 == smartlist_len(pending_cb_messages)) {
+ if (!pending_cb_messages || 0 == smartlist_len(pending_cb_messages)) {
UNLOCK_LOGS();
return;
}