(nbio_stdio.c) Try to free handle->data in case of an error

This commit is contained in:
twinaphex 2015-06-12 22:09:07 +02:00
parent d3b304ebc4
commit 49c08fdba9

View File

@ -60,7 +60,12 @@ struct nbio_t* nbio_open(const char * filename, unsigned mode)
error:
if (handle)
{
if (handle->data)
free(handle->data);
handle->data = NULL;
free(handle);
}
handle = NULL;
fclose(f);
return NULL;