1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-11 20:24:04 +03:00

python: Fix the forward_null error in Python binding codes

This patch resolves: https://bugzilla.redhat.com/show_bug.cgi?id=771021
(cherry picked from commit b80f4db9931ceea4bec1d178322058df77ece7a4)

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.)
This commit is contained in:
Osier Yang
2012-05-07 19:02:12 +08:00
committed by Daniel Veillard
parent 410cb3c0e8
commit b2c9179933

View File

@@ -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;