dovecot-2.2: lib-http server: Keep output stream referenced to a...

dovecot at dovecot.org dovecot at dovecot.org
Sat Sep 13 20:42:56 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/736a3f6bd5a8
changeset: 17797:736a3f6bd5a8
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Sep 13 23:42:17 2014 +0300
description:
lib-http server: Keep output stream referenced to avoid accessing it after destroy.

diffstat:

 src/lib-http/http-server-response.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 1daf1e2fefb9 -r 736a3f6bd5a8 src/lib-http/http-server-response.c
--- a/src/lib-http/http-server-response.c	Sat Sep 13 22:15:35 2014 +0300
+++ b/src/lib-http/http-server-response.c	Sat Sep 13 23:42:17 2014 +0300
@@ -379,6 +379,7 @@
 	iov[2].iov_len = 2;
 
 	req->state = HTTP_SERVER_REQUEST_STATE_PAYLOAD_OUT;
+	o_stream_ref(output);
 	o_stream_cork(output);
 	if (o_stream_sendv(output, iov, N_ELEMENTS(iov)) < 0) {
 		if (errno != EPIPE && errno != ECONNRESET) {
@@ -398,6 +399,7 @@
 		http_server_request_finished(resp->request);
 	}
 	o_stream_uncork(output);
+	o_stream_unref(&output);
 	return ret;
 }
 


More information about the dovecot-cvs mailing list