1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

tests: Add return value check in checkUserInfo

Commit 1c8113f9c added the call to virTypedParamsGetString without
a return value check which caused Coverity to complain especially
since other checks for the same function are made.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
John Ferlan 2019-11-03 07:39:22 -05:00
parent 11e8d37c4b
commit 77180d0f70

View File

@ -1127,7 +1127,9 @@ checkUserInfo(virTypedParameterPtr params,
snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
"user.%zu.domain", nth);
virTypedParamsGetString(params, nparams, param_name, &domain);
if (virTypedParamsGetString(params, nparams, param_name, &domain) < 0)
return -1;
if (STRNEQ_NULLABLE(expDomain, domain)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"Expected domain '%s', got '%s'",