Reduce some code around frees

This commit is contained in:
Orestis Floros
2018-08-01 18:08:26 +03:00
parent 565d38c5af
commit 50880db2c5
7 changed files with 8 additions and 15 deletions

View File

@ -501,8 +501,7 @@ ssize_t slurp(const char *path, char **buf) {
fclose(f);
if ((ssize_t)n != stbuf.st_size) {
ELOG("File \"%s\" could not be read entirely: got %zd, want %" PRIi64 "\n", path, n, (int64_t)stbuf.st_size);
free(*buf);
*buf = NULL;
FREE(*buf);
return -1;
}
return (ssize_t)n;