[libvirt] [PATCH 2/3] vbox_snapshot_conf: Resolve Coverity warnings

Ján Tomko jtomko at redhat.com
Thu Jun 12 07:15:18 UTC 2014


On 06/11/2014 03:38 PM, John Ferlan wrote:
> Clean up some Coverity warnings from commit id '4dc5d8f1'
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/vbox/vbox_snapshot_conf.c | 27 ++++++++++++++++++---------
>  1 file changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c
> index 9c78410..676a0e1 100644
> --- a/src/vbox/vbox_snapshot_conf.c
> +++ b/src/vbox/vbox_snapshot_conf.c
> @@ -1257,6 +1257,11 @@ virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachinePtr machine,
>          goto cleanup;
>      }
>      snapshot = virVBoxSnapshotConfSnapshotByName(machine->snapshot, snapshotName);
> +    if (snapshot == NULL) {
> +        virReportError(VIR_ERR_INTERNAL_ERROR,

You can use VIR_ERR_NO_DOMAIN_SNAPSHOT here

> +                       _("Unable to find the snapshot %s"), snapshotName);
> +        goto cleanup;
> +    }
>      return STREQ(snapshot->uuid, machine->currentSnapshot);
>  

ACK

Jan



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140612/c752341d/attachment-0001.sig>


More information about the libvir-list mailing list