From: Orestis Floros Date: Sat, 16 Sep 2017 21:24:15 +0000 (+0300) Subject: Fix wrong call to free X-Git-Tag: 4.15~80^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f7a7c7778ba987c30276d2c30bd99b5e2a495909;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; }