From: Kefu Chai Date: Fri, 21 Apr 2017 14:36:18 +0000 (+0800) Subject: mgr: release allocated PyString X-Git-Tag: v12.0.3~295^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2005ce83adc8f321af97e813810ad30629956a3b;p=ceph-ci.git mgr: release allocated PyString Signed-off-by: Kefu Chai --- diff --git a/src/mgr/MgrPyModule.cc b/src/mgr/MgrPyModule.cc index 4e4c42483a5..e879c70e551 100644 --- a/src/mgr/MgrPyModule.cc +++ b/src/mgr/MgrPyModule.cc @@ -61,13 +61,14 @@ int MgrPyModule::load() auto pyHandle = PyString_FromString(module_name.c_str()); auto pArgs = PyTuple_Pack(1, pyHandle); pClassInstance = PyObject_CallObject(pClass, pArgs); + Py_DECREF(pyHandle); + Py_DECREF(pArgs); if (pClassInstance == nullptr) { derr << "Failed to construct class in '" << module_name << "'" << dendl; return -EINVAL; } else { dout(1) << "Constructed class from module: " << module_name << dendl; } - Py_DECREF(pArgs); return load_commands(); }