From 407df3f2f9da2bb3911bd3819b9fb966f4ea2264 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Thu, 10 May 2012 08:50:01 +0200 Subject: [PATCH] Move nmem_reset up to beginning of loop, as it is a pre-condition. Should work as previous, but will report fewer nmem 0 bytes usage. One extra nmem_reset (on a empty) call is the price. --- src/client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client.c b/src/client.c index 9e52b0a..59e06cd 100644 --- a/src/client.c +++ b/src/client.c @@ -1092,7 +1092,7 @@ static int apply_limit(struct session_database *sdb, for (i = 0; (name = facet_limits_get(facet_limits, i, &value)); i++) { struct setting *s = 0; - + nmem_reset(nmem_tmp); for (s = sdb->settings[PZ_LIMITMAP]; s; s = s->next) { const char *p = strchr(s->name + 3, ':'); @@ -1148,7 +1148,6 @@ static int apply_limit(struct session_database *sdb, break; } } - nmem_reset(nmem_tmp); if (!s) { yaz_log(YLOG_WARN, "Target %s: limit %s used, but no limitmap defined", -- 1.7.10.4