aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Carroll <thecarrolls@jiminger.com>2011-04-10 20:41:22 -0400
committerJim Carroll <thecarrolls@jiminger.com>2011-04-14 10:04:46 -0400
commit21e35e03081aebfde5051a57016f7bf63248441e (patch)
treee32c2c3651e2782de7b253e607b2a3d3869f45a2
parentcd2c9beccae22cbb1b7a4f43599a1a6f7eb8c094 (diff)
Cleanup the potential memory leak when the Addon constructor fails.
-rw-r--r--xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp b/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp
index 446fa87b66..72bcf0e74f 100644
--- a/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp
+++ b/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp
@@ -103,6 +103,7 @@ namespace PYXBMC
if (!id)
{
PyErr_SetString(PyExc_Exception, "No valid addon id could be obtained. None was passed and the script wasn't executed in a normal xbmc manner.");
+ Py_DECREF(self);
return NULL;
}
@@ -121,6 +122,7 @@ namespace PYXBMC
if (!CAddonMgr::Get().GetAddon(id, self->pAddon))
{
PyErr_SetString(PyExc_Exception, "Could not get AddonPtr!");
+ Py_DECREF(self);
return NULL;
}
else
@@ -134,6 +136,7 @@ namespace PYXBMC
errorMessage += version.Print();
errorMessage += " plugin.";
PyErr_SetString(PyExc_Exception, errorMessage.c_str());
+ Py_DECREF(self);
return NULL;
}
}