Commit 508375e5 authored by Guido Gunther's avatar Guido Gunther

auth: Unconditionally set pamh to NULL

Don't do it only in the successful case since the handle is
not useful afterwards and later calls might otherwise reuse the handle.

Also don't use the handle in the error path after pam_end.
Signed-off-by: Guido Gunther's avatarGuido Günther <>
parent 90b2c0dd
Pipeline #36396 passed with stages
in 10 minutes and 4 seconds
......@@ -94,11 +94,9 @@ authenticate (PhoshAuth *self, const gchar* number)
ret = pam_end(priv->pamh, ret);
if (ret == PAM_SUCCESS) {
if (ret != PAM_SUCCESS)
g_warning("pam_end error %d", ret);
priv->pamh = NULL;
} else {
g_warning("pam_end error %s", pam_strerror (priv->pamh, ret));
return authenticated;
......@@ -165,7 +163,6 @@ phosh_auth_new (void)
phosh_auth_authenticate_async_start (PhoshAuth *self,
const gchar *number,
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment