dovecot-1.0: Crashfix if PAM returns a reply but the process doe...

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


details:   http://hg.dovecot.org/dovecot-1.0/rev/de5d9ffa2a45
changeset: 5336:de5d9ffa2a45
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jul 04 17:48:42 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 720cbd0c19a0 -r de5d9ffa2a45 src/auth/passdb-pam.c
--- a/src/auth/passdb-pam.c	Wed Jul 04 00:28:03 2007 +0300
+++ b/src/auth/passdb-pam.c	Wed Jul 04 17:48:42 2007 +0300
@@ -372,10 +372,11 @@ static void pam_child_input(void *contex
 	}
 
 	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__,
@@ -410,8 +411,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