[master] 1719067 Reset storage_malloc counter on allocation failure.
Poul-Henning Kamp
phk at FreeBSD.org
Fri Jan 8 10:54:17 CET 2016
commit 1719067353442a17ebbc042841834593ad1adf85
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 8f085f7..7060f55 100644
--- a/bin/varnishd/storage/storage_malloc.c
+++ b/bin/varnishd/storage/storage_malloc.c
@@ -107,6 +107,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