[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] python: Initialize new_params in virDomainSetSchedulerParameters



On 09/11/2012 10:41 PM, Federico Simoncelli wrote:
The new_params variable must be initialized in case the
virDomainGetSchedulerParameters call fails and we hit the cleanup
section before actually allocating the new parameters.

Signed-off-by: Federico Simoncelli <fsimonce redhat com>
---
  python/libvirt-override.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index bb1d881..485ed28 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -700,7 +700,7 @@ libvirt_virDomainSetSchedulerParameters(PyObject *self ATTRIBUTE_UNUSED,
      int i_retval;
      int nparams = 0;
      Py_ssize_t size = 0;
-    virTypedParameterPtr params, new_params;
+    virTypedParameterPtr params, new_params = NULL;
if (!PyArg_ParseTuple(args, (char *)"OO:virDomainSetScedulerParameters",
                            &pyobj_domain, &info))

  yes, we need initialize it.
  ACK

  Guannan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]