util/os_file: fix double-close()
authorEric Engestrom <eric.engestrom@intel.com>
Mon, 26 Aug 2019 14:30:54 +0000 (15:30 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Tue, 3 Sep 2019 23:11:51 +0000 (00:11 +0100)
Fixes: 955c63d3643f30d7db0c ("util/os_file: resize buffer to what was actually needed")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/util/os_file.c

index ae41506332d3863e77b64669b619aa551b386d3e..c670e127c6b1761a6271902045cd2f8df6c68862 100644 (file)
@@ -120,7 +120,6 @@ os_read_file(const char *filename)
    char *newbuf = realloc(buf, len);
    if (!newbuf) {
       free(buf);
-      close(fd);
       errno = -ENOMEM;
       return NULL;
    }