From b2ec22090d23cd17d91e802ea2f38a0377924207 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/SWIG@7026 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/python/pystdcommon.swg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/python/pystdcommon.swg b/Lib/python/pystdcommon.swg index ac3b7b5e9..12c370e59 100644 --- a/Lib/python/pystdcommon.swg +++ b/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;