Merge pull request #167 from moshekaplan/patch-5

Avoid leaking `iso` structures
This commit is contained in:
sudonim1 2014-07-30 13:36:24 +01:00
commit 34010c5605
1 changed files with 3 additions and 1 deletions

View File

@ -549,6 +549,7 @@ isoFile *isoOpen(const char *filename)
if (iso->handle == NULL)
{
printf("Error loading %s\n", iso->filename);
free(iso);
return NULL;
}
@ -622,6 +623,7 @@ isoFile *isoCreate(const char *filename, int flags)
iso->htable = _openfile(Zfile, O_WRONLY);
if (iso->htable == NULL)
{
free(iso);
return NULL;
}
}
@ -630,6 +632,7 @@ isoFile *isoCreate(const char *filename, int flags)
if (iso->handle == NULL)
{
printf("Error loading %s\n", iso->filename);
free(iso);
return NULL;
}
printf("isoCreate: %s ok\n", iso->filename);
@ -1050,4 +1053,3 @@ void isoClose(isoFile *iso)
free(iso);
}