You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Rall <dl...@collab.net> on 2006/12/11 19:43:02 UTC

Re: svn commit: r22646 - branches/ra_dav-refactoring/subversion/libsvn_ra_dav

On Mon, 11 Dec 2006, dionisos@tigris.org wrote:

> Author: dionisos
> Date: Mon Dec 11 10:24:05 2006
> New Revision: 22646
> 
> Log:
> ra_dav-refactoring: Assert the Neon request creation succeeded. This
> op can only fail when we're short on memory and creating an error means
> allocating memory - which we don't have...
> 
> * subversion/libsvn_ra_dav/util.c
>   (svn_ra_dav__request_create): Assert that the request was
>    succesfully created.
> 
> * subversion/libsvn_ra_dav/fetch.c
> * subversion/libsvn_ra_dav/commit.c
>   No longer create errors when the result from svn_ra_dav__request_create()
>   is NULL; it won't.
...
> --- branches/ra_dav-refactoring/subversion/libsvn_ra_dav/util.c	(original)
> +++ branches/ra_dav-refactoring/subversion/libsvn_ra_dav/util.c	Mon Dec 11 10:24:05 2006
> @@ -35,7 +35,7 @@
>  #include "svn_private_config.h"
>  
>  #include "ra_dav.h"
> -
> +#include <assert.h>
>  
>  
>  
> @@ -244,6 +244,7 @@
>    req->method = apr_pstrdup(req->pool, method);
>    req->url = apr_pstrdup(req->pool, url);
>  
> +  assert(req != NULL);
>    apr_pool_cleanup_register(reqpool, req,
>                              dav_request_cleanup,
>                              apr_pool_cleanup_null);

How about an inline comment indicating why we expect that req might be
null (e.g. out of memory)?