From 68a938e771f136446fb0b9925f50bd482afc31d5 Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Tue, 24 Nov 2015 14:05:22 +0000 Subject: [PATCH] ares__read_line: clear buf pointer on realloc failure --- ares__read_line.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ares__read_line.c b/ares__read_line.c index 6ebd42fe..36826a8e 100644 --- a/ares__read_line.c +++ b/ares__read_line.c @@ -63,6 +63,7 @@ int ares__read_line(FILE *fp, char **buf, size_t *bufsize) if (!newbuf) { free(*buf); + *buf = NULL; return ARES_ENOMEM; } *buf = newbuf;