From: John Ferlan Date: Tue, 1 Sep 2015 11:02:30 +0000 (-0400) Subject: util: Avoid Coverity FORWARD_NULL X-Git-Tag: v1.2.20-rc1~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c78e1cfcb5688059290141ce586d1298bb3f589a;p=thirdparty%2Flibvirt.git util: Avoid Coverity FORWARD_NULL 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 --- diff --git a/src/util/virdbus.c b/src/util/virdbus.c index 1cf1eef39a..78fb7953dc 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 */