dovecot: Crashfix if PAM returns a reply but the process doesn't...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jul 4 17:48:53 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/f731198279eb
changeset: 5893:f731198279eb
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jul 04 17:48:43 2007 +0300
description:
Crashfix if PAM returns a reply but the process doesn't die.

diffstat:

1 file changed, 7 insertions(+), 4 deletions(-)
src/auth/passdb-pam.c |   11 +++++++----

diffs (30 lines):

diff -r 36056f044f1f -r f731198279eb src/auth/passdb-pam.c
--- a/src/auth/passdb-pam.c	Wed Jul 04 05:10:21 2007 +0300
+++ b/src/auth/passdb-pam.c	Wed Jul 04 17:48:43 2007 +0300
@@ -374,10 +374,11 @@ static void pam_child_input(struct pam_a
 	}
 
 	request->callback(result, auth_request);
-	auth_request_unref(&auth_request);
-
-	if (--request->refcount == 0)
+
+	if (--request->refcount == 0) {
+		auth_request_unref(&auth_request);
 		i_free(request);
+	}
 }
 
 static void sigchld_handler(int signo __attr_unused__,
@@ -412,8 +413,10 @@ static void sigchld_handler(int signo __
 		}
 
 		hash_remove(pam_requests, POINTER_CAST(request->pid));
-		if (--request->refcount == 0)
+		if (--request->refcount == 0) {
+			auth_request_unref(&request->request);
 			i_free(request);
+		}
 	}
 }
 


More information about the dovecot-cvs mailing list