Skip to content

Commit

Permalink
Fixed memory leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 16, 2002
1 parent 752b317 commit 50b40f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions archivers/qpak.c
Expand Up @@ -438,6 +438,9 @@ static int qpak_populateDirectories(QPAKentry *entries, int numEntries,

static void qpak_deletePakInfo (QPAKinfo *pakInfo)
{
if (pakInfo->handle != NULL)
__PHYSFS_platformClose(pakInfo->handle);

if (pakInfo->filename != NULL)
free(pakInfo->filename);

Expand Down Expand Up @@ -533,10 +536,7 @@ static DirHandle *QPAK_openArchive(const char *name, int forWriting)

static void QPAK_dirClose(DirHandle *dirHandle)
{
QPAKinfo *info = (QPAKinfo *) dirHandle->opaque;
__PHYSFS_platformClose(info->handle);
free(info->filename);
free(info);
qpak_deletePakInfo((QPAKinfo *) dirHandle->opaque);
free(dirHandle);
} /* QPAK_dirClose */

Expand Down

0 comments on commit 50b40f2

Please sign in to comment.