mirror of
https://github.com/libretro/RetroArch
synced 2025-03-12 13:13:30 +00:00
Close file handle too in case we fail in nbio_open
This commit is contained in:
parent
b1558d651e
commit
cfa388ed77
@ -29,7 +29,10 @@ struct nbio_t* nbio_open(const char * filename, enum nbio_mode_t mode)
|
||||
handle=(struct nbio_t*)malloc(sizeof(struct nbio_t));
|
||||
|
||||
if (!handle)
|
||||
{
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
handle->f = f;
|
||||
handle->len = 0;
|
||||
@ -45,6 +48,7 @@ struct nbio_t* nbio_open(const char * filename, enum nbio_mode_t mode)
|
||||
if (!handle->data)
|
||||
{
|
||||
free(handle);
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user