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
5dad79ff34
commit
b5583d6cf4
|
@ -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