From 7dba15ba0a8a2503230682bcd135130e1e7a49e9 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Sun, 6 Mar 2005 06:41:43 +0000 Subject: [PATCH] fix memory leak reported by Bo Peng git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7026 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/python/pystdcommon.swg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SWIG/Lib/python/pystdcommon.swg b/SWIG/Lib/python/pystdcommon.swg index ac3b7b5e9..12c370e59 100644 --- a/SWIG/Lib/python/pystdcommon.swg +++ b/SWIG/Lib/python/pystdcommon.swg @@ -133,8 +133,8 @@ namespace swig { struct traits_as { static Type as(PyObject *obj, bool throw_error) { Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : 0) && v; - if (res) { + int res = (obj ? traits_asptr::asptr(obj, &v) : 0); + if (res && v) { if (res == SWIG_NEWOBJ) { Type r(*v); delete v;