Merge pull request #12 from stephenmathieson/fix/memory-leak

Fix memory leak
This commit is contained in:
Krzysztof Gabis 2013-12-06 12:32:21 -08:00
commit 148e0ccbef

View File

@ -161,6 +161,7 @@ static char * read_file(const char * filename) {
if (fread(file_contents, file_size, 1, fp) < 1) { if (fread(file_contents, file_size, 1, fp) < 1) {
if (ferror(fp)) { if (ferror(fp)) {
fclose(fp); fclose(fp);
parson_free(file_contents);
return NULL; return NULL;
} }
} }