]> source.dussan.org Git - rspamd.git/commitdiff
Another bad read detected.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 4 Aug 2011 16:43:06 +0000 (20:43 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 4 Aug 2011 16:43:06 +0000 (20:43 +0400)
src/protocol.c

index 4e15a47d84c147fcb64c66cd748d6a665535ba99..175dbbdbb02750a565440197132f53c6223d9dd2 100644 (file)
@@ -1195,16 +1195,18 @@ show_metric_result (gpointer metric_name, gpointer metric_value, void *user_data
                        }
                }
        }
+       if (cd->alive) {
 #ifdef HAVE_CLOCK_GETTIME
-       cd->log_offset += rspamd_snprintf (cd->log_buf + cd->log_offset,
+               cd->log_offset += rspamd_snprintf (cd->log_buf + cd->log_offset,
                        cd->log_size - cd->log_offset, "]), len: %z, time: %s, dns req: %d,",
                        task->msg->len, calculate_check_time (&task->tv, &task->ts,
                                        task->cfg->clock_res), task->dns_requests);
 #else
-       cd->log_offset += rspamd_snprintf (cd->log_buf + cd->log_offset, cd->log_size - cd->log_offset,
+               cd->log_offset += rspamd_snprintf (cd->log_buf + cd->log_offset, cd->log_size - cd->log_offset,
                        "]), len: %z, time: %s, dns req: %d,",
                        task->msg->len, calculate_check_time (&task->tv, task->cfg->clock_res), task->dns_requests);
 #endif
+       }
 }
 
 static gboolean