Merge pull request #1782 from heuripedes/master

Memleak fixes
This commit is contained in:
Twinaphex 2015-06-12 23:22:22 +02:00
commit 516ff5468f
3 changed files with 6 additions and 3 deletions

View File

@ -199,4 +199,8 @@ void nbio_free(struct nbio_t* handle)
}
fclose(handle->f);
free(handle->data);
handle->f = NULL;
handle->data = NULL;
free(handle);
}

View File

@ -227,7 +227,6 @@ void rpng_nbio_load_image_free(struct rpng_t *rpng)
free(rpng->process.stream);
}
if (rpng)
free(rpng);
}

View File

@ -332,7 +332,7 @@ static int cb_nbio_generic(nbio_handle_t *nbio, size_t *len)
if (!ptr)
{
free(nbio->image.handle);
rpng_nbio_load_image_free(nbio->image.handle);
nbio->image.handle = NULL;
nbio->image.cb = NULL;