Commit e86f60a4 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Remove unused include

free buffer on error.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@663 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 8517c909
......@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment