[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Fix Win32 file handle leak in translate-test.exe?

From: Erik Huelsmann <e.huelsmann_at_gmx.net>
Date: 2003-12-17 17:27:19 CET

I'm running make check now, but could someone verify that this fixes the
reported file handle leak?

Thanks!

bye,

Erik.

PS: Karl, even though "if (d)" looks the same as the one you commented
about; it isn't: in the old code d could not be null or it would have to be a
valid close parameter. In this code I use d != NULL as a flag that d needs
closing. I thought to use a separate flag for it at first, but there is no system I
know which returns NULL as a valid *FILE.

Index: subversion/libsvn_subr/subst.c
===================================================================
--- subversion/libsvn_subr/subst.c (revision 8017)
+++ subversion/libsvn_subr/subst.c (working copy)
@@ -751,6 +751,7 @@
     goto error;
  
   err = svn_io_file_close (d, pool);
+ d = NULL;
   if (err)
     goto error;
  
@@ -761,6 +762,9 @@
  
   return SVN_NO_ERROR;
  error:
+ if (d)
+ svn_error_clear (svn_io_file_close (d, pool));
+
   svn_error_clear (svn_io_remove_file (dst_tmp, pool));
  
   return err;

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 17 17:28:02 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.