dovecot-2.2: lib-http: Don't double-free request memory when abo...

dovecot at dovecot.org dovecot at dovecot.org
Wed Apr 10 18:00:25 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/79a74a23b742
changeset: 16267:79a74a23b742
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Apr 10 18:00:12 2013 +0300
description:
lib-http: Don't double-free request memory when aborting them.

diffstat:

 src/lib-http/http-client-connection.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r 6466af800ed4 -r 79a74a23b742 src/lib-http/http-client-connection.c
--- a/src/lib-http/http-client-connection.c	Wed Apr 10 17:53:24 2013 +0300
+++ b/src/lib-http/http-client-connection.c	Wed Apr 10 18:00:12 2013 +0300
@@ -107,9 +107,9 @@
 	conn->closing = TRUE;
 	
 	array_foreach_modifiable(&conn->request_wait_list, req) {
+		i_assert((*req)->submitted);
 		http_client_request_error(*req, status, error);
-		http_client_request_unref(req);
-	}	
+	}
 	array_clear(&conn->request_wait_list);
 	http_client_connection_unref(_conn);
 }
@@ -819,9 +819,9 @@
 
 	/* abort all pending requests */
 	array_foreach_modifiable(&conn->request_wait_list, req) {
+		i_assert((*req)->submitted);
 		http_client_request_error(*req, HTTP_CLIENT_REQUEST_ERROR_ABORTED,
 			"Aborting");
-		http_client_request_unref(req);
 	}
 	array_free(&conn->request_wait_list);
 


More information about the dovecot-cvs mailing list