From 0d17115d2c5669afd22c42a205e091330d8ef6d9 Mon Sep 17 00:00:00 2001
From: Matthew Barnes <mbarnes@redhat.com>
Date: Fri, 15 Jan 2010 21:51:35 -0500
Subject: 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.
---
 modules/plugin-python/e-plugin-python.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'modules/plugin-python/e-plugin-python.c')

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 {
 
-- 
cgit