mirror of
https://github.com/kgabis/parson.git
synced 2025-02-05 17:05:29 +00:00
Merge pull request #12 from stephenmathieson/fix/memory-leak
Fix memory leak
This commit is contained in:
commit
148e0ccbef
1
parson.c
1
parson.c
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user