The check whether @keyfile is non-NULL is before locking @sess, but uses
the 'error' label which unlocks '@sess'.
While touching the error path, update the error message to be on one
line.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
if (!keyfile) {
virReportError(VIR_ERR_LIBSSH, "%s",
- _("Key file path must be provided "
- "for private key authentication"));
- ret = -1;
- goto error;
+ _("Key file path must be provided for private key authentication"));
+ return -1;
}
virObjectLock(sess);