pam/4e8af9027dab25ebff3fa1b6e5542640611778c9.patch
2024-05-28 04:43:18 +03:00

23 lines
934 B
Diff

From 4e8af9027dab25ebff3fa1b6e5542640611778c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Sat, 5 Aug 2023 17:44:29 +0200
Subject: [PATCH] pam_start: free handlers on handler init failure
If the pam handlers fail to initialize halfway, clean them up
afterwards. Since we set the handle to NULL callers can't clean them.
---
libpam/pam_start.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libpam/pam_start.c b/libpam/pam_start.c
index 99dd03898..1fc36b3ed 100644
--- a/libpam/pam_start.c
+++ b/libpam/pam_start.c
@@ -143,6 +143,7 @@ static int _pam_start_internal (
if ( _pam_init_handlers(*pamh) != PAM_SUCCESS ) {
pam_syslog(*pamh, LOG_ERR, "pam_start: failed to initialize handlers");
+ _pam_free_handlers(*pamh);
_pam_drop_env(*pamh); /* purge the environment */
_pam_drop((*pamh)->pam_conversation);
_pam_drop((*pamh)->service_name);