On 09/04/2015 10:31 AM, John Ferlan wrote:
Coverity claims it could be possible to call virDBusTypeStackFree with
*stack == NULL and although the two API's that call it don't appear to
allow that - I suppose it's better to be safe than sorry

Signed-off-by: John Ferlan <jfer...@redhat.com>
---
  src/util/virdbus.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/src/util/virdbus.c b/src/util/virdbus.c
index 1cf1eef..78fb795 100644
--- a/src/util/virdbus.c
+++ b/src/util/virdbus.c
@@ -544,6 +544,10 @@ static void virDBusTypeStackFree(virDBusTypeStack **stack,
                                   size_t *nstack)
  {
      size_t i;
+
+    if (!*stack)
+        return;
+
      /* The iter in the first level of the stack is the
       * root iter which must not be freed
       */

ACK.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to