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

Re: svn commit: rev 7466 - trunk/subversion/libsvn_ra_dav

From: Greg Stein <gstein_at_lyra.org>
Date: 2003-10-22 12:54:09 CEST

On Tue, Oct 21, 2003 at 03:16:28PM -0500, kfogel@tigris.org wrote:
>...
> +++ trunk/subversion/libsvn_ra_dav/util.c Tue Oct 21 15:16:28 2003
>...
> @@ -676,15 +676,17 @@
> rv = ne_request_dispatch(request);
>
> statstruct = ne_get_status(request);

Hmm. Where do you suppose *statstruct is allocated? Do you ever free it? I
don't see anything freeing this. Hunh...

Kind of suspicious here, don't you think? :-)

> - *code = statstruct->code;
> code_desc = apr_pstrdup(pool, statstruct->reason_phrase);
> + if (code_p)
> + *code_p = statstruct->code;
>
> ne_request_destroy(request);

Hey... look at this. We destroy the request. But wait. Is it possible that
statstruct refers to this?

[check... check...]

It sure does. What do you know? No need to free statstruct above. Whew.
Everything is good.

[ wait for it... wait... ]

> ne_xml_destroy(error_parser);
>
> /* If the status code was one of the two that we expected, then go
> ahead and return now. IGNORE any marshalled error. */
> - if (rv == NE_OK && (*code == okay_1 || *code == okay_2))
> + if (rv == NE_OK
> + && (statstruct->code == okay_1 || statstruct->code == okay_2))
> return SVN_NO_ERROR;

Oh. Um. Maybe not so good.

:-)

Cheers,
-g

p.s. I'd suggest copying statstruct->code into a local var :-)

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 22 12:59:38 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.