chiark / gitweb /
fix regression of read_full_file() in fileio.c
authorShawn Landden <shawn@churchofgit.com>
Sun, 1 Dec 2013 04:02:27 +0000 (20:02 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 1 Dec 2013 04:04:17 +0000 (23:04 -0500)
my e93c33d4aa broke this stupidly

src/shared/fileio.c

index ac1b409a1c7efa1c4aaf274055922a0d7508cd88..ede88196b5f1a9374a5b387a9d72278bf86255cb 100644 (file)
@@ -240,6 +240,7 @@ int read_full_file(const char *fn, char **contents, size_t *size) {
 
         buf[l] = 0;
         *contents = buf;
+        buf = NULL; /* do not free */
 
         if (size)
                 *size = l;