mirror of https://github.com/PCSX2/pcsx2.git
Prevent filehandle from leaking
This commit is contained in:
parent
8a43789db5
commit
82dd025860
|
@ -537,12 +537,16 @@ void OnCreateZ(GtkButton *button, gpointer user_data)
|
||||||
t = fopen(table, "wb");
|
t = fopen(table, "wb");
|
||||||
|
|
||||||
if (t == NULL) return;
|
if (t == NULL) return;
|
||||||
if (CDR_open() == -1) return;
|
if (CDR_open() == -1)
|
||||||
|
{
|
||||||
|
fclose(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (CDR_getTD(ftrack, start) == -1)
|
if (CDR_getTD(ftrack, start) == -1)
|
||||||
{
|
{
|
||||||
printf("Error getting TD\n");
|
printf("Error getting TD\n");
|
||||||
CDR_close();
|
CDR_close();
|
||||||
|
fclose(t);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -550,6 +554,7 @@ void OnCreateZ(GtkButton *button, gpointer user_data)
|
||||||
{
|
{
|
||||||
printf("Error getting TD\n");
|
printf("Error getting TD\n");
|
||||||
CDR_close();
|
CDR_close();
|
||||||
|
fclose(t);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,6 +562,7 @@ void OnCreateZ(GtkButton *button, gpointer user_data)
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
{
|
{
|
||||||
CDR_close();
|
CDR_close();
|
||||||
|
fclose(t);
|
||||||
printf("Error opening %s", IsoFile);
|
printf("Error opening %s", IsoFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue