From: Orestis Floros Date: Sat, 16 Sep 2017 21:24:15 +0000 (+0300) Subject: Fix wrong call to free X-Git-Tag: 4.14.1~29 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b5583d6cf4e0426d9aedd589f18e03407793199b;p=i3%2Fi3 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. --- diff --git a/src/util.c b/src/util.c index cd5ee03e..ba0969c7 100644 --- a/src/util.c +++ b/src/util.c @@ -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; }