mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
virNetLibsshSessionAuthAddPrivKeyAuth: Don't unlock unlocked 'sess' on error
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>
This commit is contained in:
parent
26fedf9218
commit
34e522418f
@ -1020,10 +1020,8 @@ virNetLibsshSessionAuthAddPrivKeyAuth(virNetLibsshSessionPtr sess,
|
||||
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user