* dcrt0.cc (insert_file): Fix resource leaks (CIDs 59987, 59988).
This commit is contained in:
parent
efaf85c5e6
commit
a1fd4b1a03
|
@ -1,3 +1,7 @@
|
||||||
|
2014-06-23 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* dcrt0.cc (insert_file): Fix resource leaks (CIDs 59987, 59988).
|
||||||
|
|
||||||
2014-06-23 Corinna Vinschen <corinna@vinschen.de>
|
2014-06-23 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* ldap.cc (CYG_LDAP_TIMEOUT): Set to 5 secs.
|
* ldap.cc (CYG_LDAP_TIMEOUT): Set to 5 secs.
|
||||||
|
|
|
@ -115,6 +115,7 @@ insert_file (char *name, char *&cmd)
|
||||||
size = GetFileSize (f, NULL);
|
size = GetFileSize (f, NULL);
|
||||||
if (size == 0xFFFFFFFF)
|
if (size == 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
|
CloseHandle (f);
|
||||||
debug_printf ("couldn't get file size for '%s', %E", name);
|
debug_printf ("couldn't get file size for '%s', %E", name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -123,6 +124,7 @@ insert_file (char *name, char *&cmd)
|
||||||
char *tmp = (char *) malloc (new_size);
|
char *tmp = (char *) malloc (new_size);
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
{
|
{
|
||||||
|
CloseHandle (f);
|
||||||
debug_printf ("malloc failed, %E");
|
debug_printf ("malloc failed, %E");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -134,6 +136,7 @@ insert_file (char *name, char *&cmd)
|
||||||
CloseHandle (f);
|
CloseHandle (f);
|
||||||
if (!rf_result || (rf_read != size))
|
if (!rf_result || (rf_read != size))
|
||||||
{
|
{
|
||||||
|
free (tmp);
|
||||||
debug_printf ("ReadFile failed, %E");
|
debug_printf ("ReadFile failed, %E");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue