]> err.no Git - varnish/commitdiff
Remove unused include
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 5 Aug 2006 12:23:09 +0000 (12:23 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 5 Aug 2006 12:23:09 +0000 (12:23 +0000)
free buffer on error.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@663 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/common_cli.c

index 71f70c6d35dfe15ba63c7a54d2e51c19cb4540b3..9435db37e56b391e95cfeb0772f3ef8b71398ffa 100644 (file)
@@ -21,7 +21,6 @@
 #include "cli.h"
 #include "cli_priv.h"
 #include "common_cli.h"
-#include "libvarnish.h"
 
 void
 cli_out(struct cli *cli, const char *fmt, ...)
@@ -93,8 +92,10 @@ cli_readres(int fd, unsigned *status, char **ptr)
        p = malloc(v + 1);
        assert(p != NULL);
        i = read(fd, p, v + 1);
-       if (i < 0)
+       if (i < 0) {
+               free(p);
                return (i);
+       }
        assert(i == v + 1);
        assert(p[v] == '\n');
        p[v] = '\0';