Fixed memory leak.
This commit is contained in:
parent
752b317ca4
commit
50b40f22a9
|
@ -438,6 +438,9 @@ static int qpak_populateDirectories(QPAKentry *entries, int numEntries,
|
||||||
|
|
||||||
static void qpak_deletePakInfo (QPAKinfo *pakInfo)
|
static void qpak_deletePakInfo (QPAKinfo *pakInfo)
|
||||||
{
|
{
|
||||||
|
if (pakInfo->handle != NULL)
|
||||||
|
__PHYSFS_platformClose(pakInfo->handle);
|
||||||
|
|
||||||
if (pakInfo->filename != NULL)
|
if (pakInfo->filename != NULL)
|
||||||
free(pakInfo->filename);
|
free(pakInfo->filename);
|
||||||
|
|
||||||
|
@ -533,10 +536,7 @@ QPAK_openArchive_failed:
|
||||||
|
|
||||||
static void QPAK_dirClose(DirHandle *dirHandle)
|
static void QPAK_dirClose(DirHandle *dirHandle)
|
||||||
{
|
{
|
||||||
QPAKinfo *info = (QPAKinfo *) dirHandle->opaque;
|
qpak_deletePakInfo((QPAKinfo *) dirHandle->opaque);
|
||||||
__PHYSFS_platformClose(info->handle);
|
|
||||||
free(info->filename);
|
|
||||||
free(info);
|
|
||||||
free(dirHandle);
|
free(dirHandle);
|
||||||
} /* QPAK_dirClose */
|
} /* QPAK_dirClose */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue