From f64ce8fed1bd4a7e111ea645a1237d031bbbc8aa Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 14 Oct 2024 18:55:46 +0200 Subject: [PATCH] Only try to adjust upstream counters if this query has been forwarded Signed-off-by: DL6ER --- src/gc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gc.c b/src/gc.c index 8fe91863..b4efdb7a 100644 --- a/src/gc.c +++ b/src/gc.c @@ -339,10 +339,13 @@ void runGC(const time_t now, time_t *lastGCrun, const bool flush) domain->count--; // Adjust upstream counter (no overTime information) - upstreamsData *upstream = getUpstream(query->upstreamID, true); - if(upstream != NULL) - // Adjust upstream counter - upstream->count--; + if(query->upstreamID > -1) + { + upstreamsData *upstream = getUpstream(query->upstreamID, true); + if(upstream != NULL) + // Adjust upstream counter + upstream->count--; + } // Change other counters according to status of this query switch(query->status)