Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   EXT3 Users (http://www.linux-archive.org/ext3-users/)
-   -   PATCH : pyblock: Add missing DECREF and fix error handling in pydmraid_raidset_get_map() (http://www.linux-archive.org/ext3-users/252561-patch-pyblock-add-missing-decref-fix-error-handling-pydmraid_raidset_get_map.html)

Joel Granados 02-25-2009 08:12 PM

PATCH : pyblock: Add missing DECREF and fix error handling in pydmraid_raidset_get_map()
 
looks ok.
On Wed, Feb 25, 2009 at 08:17:06PM +0100, Hans de Goede wrote:
> pydmraid_raidset_get_map() was missing a DECREF for the imported module and
> would return a non NULL value in case of error when the __init__ call failed.
> ---
> dmraid.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/dmraid.c b/dmraid.c
> index 51d4ad6..23e1bbc 100644
> --- a/dmraid.c
> +++ b/dmraid.c
> @@ -877,12 +877,13 @@ pydmraid_raidset_get_map(PyObject *self, void *data)
>
> iret = PyObject_CallMethod(map, "__init__", "sO", rs->name, table);
> if (!iret) {
> - Py_DECREF(map);
> + Py_CLEAR(map);
> goto out;
> }
>
> out:
> Py_XDECREF(iret);
> + Py_XDECREF(m);
> Py_XDECREF(table);
> if (!map && !PyErr_Occurred()) {
> if (errno != 0)
> --
> 1.6.1.3
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

--
Joel Andres Granados
Brno, Czech Republic, Red Hat.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 08:35 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.