From: des Date: Sun, 17 Feb 2008 08:54:53 +0000 (+0000) Subject: Make sure buf is freed in error case (Coverity CID#9) X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44e2bd5aaab9596a1b8dd71727000a5cbf86a615;p=varnish 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 --- 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; }