mirror of https://github.com/ipxe/ipxe.git
[util] Avoid calling fclose(NULL) in zbin.c
Must check that argument to a fclose() is not NULL -- we can get to the 'err' label when file was not opened. fclose(NULL) is known to produce core dump on some platforms and we don't want zbin to fail so loudly. Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>pull/1/head
parent
99251f5b32
commit
6de45ad4ae
|
@ -90,7 +90,8 @@ static int read_file ( const char *filename, void **buf, size_t *len ) {
|
|||
return 0;
|
||||
|
||||
err:
|
||||
fclose ( file );
|
||||
if ( file )
|
||||
fclose ( file );
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue