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

Re: svn commit: r1466497 - in /subversion/trunk/subversion/bindings/swig: core.i python/libsvn_swig_py/swigutil_py.c python/libsvn_swig_py/swigutil_py.h

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Wed, 10 Apr 2013 16:12:37 +0100

cmpilato_at_apache.org writes:

> Author: cmpilato
> Date: Wed Apr 10 14:38:17 2013
> New Revision: 1466497

> +svn_swig_py_config_auth_walk_func(svn_boolean_t *delete_cred,
> + void *walk_baton,
> + const char *cred_kind,
> + const char *realmstring,
> + apr_hash_t *hash,
> + apr_pool_t *scratch_pool)
> {
> - PyObject *function = cleanup_baton;
> + PyObject *function = walk_baton;
> PyObject *result;
> - PyObject *py_scratch_pool;
> + PyObject *py_scratch_pool, *py_hash;
> svn_error_t *err = SVN_NO_ERROR;
>
> *delete_cred = FALSE;
> @@ -3310,11 +3310,16 @@ svn_swig_py_auth_cleanup_func(svn_boolea
> err = callback_exception_error();
> goto finished;
> }
> + py_hash = svn_swig_py_prophash_to_dict(hash);
> + if (py_hash == NULL)
> + {
> + err = callback_exception_error();
> + goto finished;
> + }

This error path bypasses the Py_DECREF for py_hash. Does that matter?
I'm still trying to understand exactly when Py_DECREF and Py_INCREF are
required.

>
> - if ((result = PyObject_CallFunction(function,
> - (char *)"sssO",
> + if ((result = PyObject_CallFunction(function, (char *)"ssOO",
> cred_kind, realmstring,
> - provider, py_scratch_pool)) == NULL)
> + py_hash, py_scratch_pool)) == NULL)
> {
> err = callback_exception_error();
> }
> @@ -3328,6 +3333,7 @@ svn_swig_py_auth_cleanup_func(svn_boolea
> err = callback_bad_return_error("Not an integer");
> Py_DECREF(result);
> }
> + Py_DECREF(py_hash);
> Py_DECREF(py_scratch_pool);
>
> finished:

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download
Received on 2013-04-10 17:13:14 CEST

This is an archived mail posted to the Subversion Dev mailing list.