]> err.no Git - varnish/commitdiff
Make sure buf is freed in error case (Coverity CID#9)
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 17 Feb 2008 08:54:53 +0000 (08:54 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 17 Feb 2008 08:54:53 +0000 (08:54 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2493 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishreplay/varnishreplay.c

index a36eef73065f2884f900f2dde90710e74c3fbbbf..b640c8c04f111d84fe810e1366b94b8ae36693d3 100644 (file)
@@ -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;
        }