Plug potential memory leak in try_to_xslt_open_csv

Free temp buffer if realloc fails.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2013-12-11 00:53:31 +01:00 committed by Dirk Hohndel
parent ef3a51f6ee
commit 511f8b8885

4
file.c
View file

@ -122,8 +122,10 @@ static int try_to_xslt_open_csv(const char *filename, struct memblock *mem, char
memcpy(mem->buffer + mem->size + 5, "</csv>", 7);
mem->buffer = buf;
mem->size += strlen("<csv></csv>");
} else
} else {
free(mem->buffer);
return 1;
}
return 0;
}