From 44e2bd5aaab9596a1b8dd71727000a5cbf86a615 Mon Sep 17 00:00:00 2001 From: des Date: Sun, 17 Feb 2008 08:54:53 +0000 Subject: [PATCH] Make sure buf is freed in error case (Coverity CID#9) git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2493 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishreplay/varnishreplay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishreplay/varnishreplay.c b/varnish-cache/bin/varnishreplay/varnishreplay.c index a36eef73..b640c8c0 100644 --- a/varnish-cache/bin/varnishreplay/varnishreplay.c +++ b/varnish-cache/bin/varnishreplay/varnishreplay.c @@ -363,7 +363,8 @@ read_block(int length, int sock) (2048 < length - nbuf ? 2048 : length - nbuf)); if (n <= 0) { thread_log(0, "failed reading the block\n"); - return (-1); + nbuf = -1; + break; } nbuf += n; } -- 2.39.5