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

Re: missing error checking in svn_config__parse_file

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2005-04-04 11:47:01 CEST

On Mon, 4 Apr 2005, Ph. Marek wrote:

> [[[
>
> * subversion/libsvn_subr/config_file.c
> (svn_config__parse_file): Check the error code possibly
> returned
>
> ]]]
>
> === subversion/libsvn_subr/config_file.c
> ==================================================================
> --- subversion/libsvn_subr/config_file.c (revision 404)
> +++ subversion/libsvn_subr/config_file.c (local)
> @@ -491,6 +491,9 @@
> err = parse_option (&ch, &ctx);
> break;
> }
> +
> + if (err != SVN_NO_ERROR)
> + return err;
> }
> while (ch != EOF);
>

This leaks the open file. also note that whenever err is set, ch gets set
to EOF, so the loop will terminate in that case. So, you don't need this
fix.

OTOH, looking at the code below, it seems that we leak an error if err got
set in the loop and ferror returns true. It needs a deeper look, though.

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Apr 4 11:42:59 2005

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.