diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-01-16 10:51:35 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-01-16 10:51:35 +0800 |
commit | 0d17115d2c5669afd22c42a205e091330d8ef6d9 (patch) | |
tree | fc1b7a83f6a2507e734ac8f0fe22b6cf3c9f4e9e /modules | |
parent | cae22334fa6bc395ccc421b09e0af94c89297c41 (diff) | |
download | gsoc2013-evolution-0d17115d2c5669afd22c42a205e091330d8ef6d9.tar.gz gsoc2013-evolution-0d17115d2c5669afd22c42a205e091330d8ef6d9.tar.zst gsoc2013-evolution-0d17115d2c5669afd22c42a205e091330d8ef6d9.zip |
Fix a potential uninitialized argument in e-plugin-python.c.
if (PyCallable_Check (priv->pClass))
pInstance = PyObject_CallObject (priv->pClass, NULL);
pValue = PyObject_CallMethod (pInstance, (gchar *) name, NULL);
'pInstance' may be uninitialzed in call to PyObject_CallMethod().
Found by the Clang Static Analyzer.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/plugin-python/e-plugin-python.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/plugin-python/e-plugin-python.c b/modules/plugin-python/e-plugin-python.c index 747ba57bac..6971a35543 100644 --- a/modules/plugin-python/e-plugin-python.c +++ b/modules/plugin-python/e-plugin-python.c @@ -101,7 +101,7 @@ plugin_python_invoke (EPlugin *plugin, EPluginPython *plugin_python; EPluginPythonPrivate *priv; PyObject *pModuleName, *pFunc; - PyObject *pInstance, *pValue = NULL; + PyObject *pValue = NULL; plugin_python = E_PLUGIN_PYTHON (plugin); priv = plugin_python->priv; @@ -144,10 +144,12 @@ plugin_python_invoke (EPlugin *plugin, if (priv->pClass) { - if (PyCallable_Check (priv->pClass)) - pInstance = PyObject_CallObject (priv->pClass, NULL); + if (PyCallable_Check (priv->pClass)) { + PyObject *pInstance; - pValue = PyObject_CallMethod (pInstance, (gchar *) name, NULL); + pInstance = PyObject_CallObject (priv->pClass, NULL); + pValue = PyObject_CallMethod (pInstance, (gchar *) name, NULL); + } } else { |