[4.1] da727cb Reset storage_malloc counter on allocation failure.
Lasse Karstensen
lkarsten at varnish-software.com
Thu Jan 14 15:15:12 CET 2016
commit da727cb9c4889a5575e7cce37d31deaadc99ed3b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Fri Jan 8 09:53:40 2016 +0000
Reset storage_malloc counter on allocation failure.
Submitted by: github::onovy
diff --git a/bin/varnishd/storage/storage_malloc.c b/bin/varnishd/storage/storage_malloc.c
index 87b634f..23d7012 100644
--- a/bin/varnishd/storage/storage_malloc.c
+++ b/bin/varnishd/storage/storage_malloc.c
@@ -106,6 +106,7 @@ sma_alloc(const struct stevedore *st, size_t size)
* XXX: Not want to pick up the lock twice just for stats.
*/
sma_sc->stats->c_fail++;
+ sma_sc->sma_alloc -= size;
sma_sc->stats->c_bytes -= size;
sma_sc->stats->g_alloc--;
sma_sc->stats->g_bytes -= size;
More information about the varnish-commit
mailing list