util/os_file: fix double-close()

Fixes: 955c63d364 ("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>
(cherry picked from commit 1667360f7d)
This commit is contained in:
Eric Engestrom 2019-08-26 15:30:54 +01:00 committed by Dylan Baker
parent 1a4e7d7293
commit ba255cdd50

View 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;
}