
On Thu, Apr 09, 2015 at 05:31:08 -0400, John Ferlan wrote:
On 04/09/2015 05:26 AM, Peter Krempa wrote:
Because you touched it - Coverity whines that 'error' is not checked for NULL:
(8) Event returned_null: "virJSONValueObjectGet" returns null (checked 96 out of 99 times). [details] (16) Event var_assigned: Assigning: "error" = null return value from "virJSONValueObjectGet". Also see events: (17) Event dereference: Dereferencing a pointer that might be null "error" when calling "virJSONValueObjectGetString". [details]
I hate coverity for this. That's a false positive due to the fact that we check right away that the reply object contains the error subobject.
How about a "sa_assert(event);"
I hate those to be honest.
Coverity is only complaining because so many places check "if (error) ? xxx : yyy"
And yes it does work, I just checked
John
I've refactored a few other places, they should work nice together and get rid of the error. I'll post v2 of the patches that can't be pushed separately after I finish rebasing. Peter