mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
Coverity: Resolve a FORWARD_NULL
Recent changes in the module seemed to have caused Coverity to reanalyze certain parts of the code. Previously the code was modified via commit id '11a11812' to resolve a different error (perhaps DEADCODE). Up through commit id '7b3f1f8c' there were no issues. The new error indicats the 'outbuf' was checked for NULL and then complains because of the dereference. Adding checks for non-NULL prior to the deref resulted in a DEADCODE message. So, resolve using an sa_assert() to keep Coverity quiet especially since it doesn't understand that outbuf will change as a result of a successful virCommandRun() call.
This commit is contained in:
parent
b2e4ace220
commit
e38264f310
@ -690,6 +690,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sa_assert(outbuf);
|
||||||
if (*outbuf) {
|
if (*outbuf) {
|
||||||
puts("output buffer is not an allocated empty string");
|
puts("output buffer is not an allocated empty string");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user