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

Re: Blame temporary file leak on error

From: Erik Huelsmann <e.huelsmann_at_gmx.net>
Date: 2003-12-19 01:32:38 CET

BTW: This patch will also be available at
http://encorps.dsnalias.com/svn-public/patches/blame-temp-file-leak.log-patch

To comment on my own patch:

> SVN_ERR (svn_io_open_unique_file (&file, &tmp,
> - svn_path_join (temp_dir, "tmp", pool), ".tmp",
> - FALSE, pool));
> + svn_path_join (temp_dir, "tmp",
> pool),
> + ".tmp", FALSE, iterpool));
> +
> + /* Now that we have a valid temp file, make sure it is removed
> again;
> + assign it to the current iterpool, then it gets cleared *after*
> the
> + next iteration */
> + apr_pool_cleanup_register (iterpool, file,
> + temporary_file_cleanup, NULL);
> +

Brane told me on my patch for svn_subst_copy_and_translate that it was
incorrect since there were SVN_ERR's before I used goto's to jump to the cleanup
part of the routine. I do almost the same here, but I believe that to be
correct: If svn_io_open_unique_file returns an error, I cannot use the contents of
its return parameters (ie. tmp) to do cleanup. The earliest moment that I
*can* (and need to) do cleanup is if the open is successful: a temp file exists
which possibly needs cleaning up.

bye,

Erik.

-- 
+++ 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 Fri Dec 19 01:33:10 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.