[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: Ph. Marek <philipp.marek_at_bmlv.gv.at>
Date: 2005-04-04 12:18:10 CEST

On Monday 04 April 2005 11:47, Peter N. Lundblad wrote:
> 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.
No, it doesn't. The call to parse_option has no ch=EOF, and I'm not sure if
it's set everywhere.
          else
            err = parse_option (&ch, &ctx);
          break;
And from my feeling, the test should be for
 err != SVN_NO_ERROR,
not some other secondary variable, which is likely to be forgotten (as it
happened me with parsing escape-characters!)

> 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.
Ok.
Leaving it to you.

Regards,

Phil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Apr 4 12:22:19 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.