From 2f04eb3b4791df014b6ce7f2671318a52b306588 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Wed, 2 May 2012 23:05:59 +0800 Subject: Coverity: Fix the forward_null error in Python binding codes Related coverity log: Error: FORWARD_NULL: /builddir/build/BUILD/libvirt-0.9.10/python/libvirt-override.c:355: assign_zero: Assigning: "params" = 0. /builddir/build/BUILD/libvirt-0.9.10/python/libvirt-override.c:458: var_deref_model: Passing null variable "params" to function "getPyVirTypedParameter", which dereferences it. (The dereference is assumed on the basis of the 'nonnull' parameter attribute.) --- libvirt-override.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt-override.c b/libvirt-override.c index 56f96ba..130e702 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -71,7 +71,7 @@ static char *py_str(PyObject *obj) /* Helper function to convert a virTypedParameter output array into a * Python dictionary for return to the user. Return NULL on failure, * after raising a python exception. */ -static PyObject * ATTRIBUTE_NONNULL(1) +static PyObject * getPyVirTypedParameter(const virTypedParameterPtr params, int nparams) { PyObject *key, *val, *info; -- cgit