Fix wrong call to free
To confirm, assign n to a constant value and try to use the append_layout command. Without the change i3 crashes.
This commit is contained in:
parent
205dd76096
commit
f7a7c7778b
|
@ -501,7 +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 %zd\n", path, n, stbuf.st_size);
|
||||
free(buf);
|
||||
free(*buf);
|
||||
*buf = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue