dovecot-2.2: lib-http: Added asserts to all refcount increments.
dovecot at dovecot.org
dovecot at dovecot.org
Mon Sep 28 10:56:06 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/c30c30c1e642
changeset: 19236:c30c30c1e642
user: Timo Sirainen <tss at iki.fi>
date: Mon Sep 28 13:54:28 2015 +0300
description:
lib-http: Added asserts to all refcount increments.
These could catch situations where an already freed object's refcount is
attempted to be increased.
diffstat:
src/lib-http/http-client-connection.c | 1 +
src/lib-http/http-client-request.c | 1 +
src/lib-http/http-server-connection.c | 1 +
src/lib-http/http-server-request.c | 1 +
4 files changed, 4 insertions(+), 0 deletions(-)
diffs (44 lines):
diff -r 77486e114423 -r c30c30c1e642 src/lib-http/http-client-connection.c
--- a/src/lib-http/http-client-connection.c Mon Sep 28 13:53:22 2015 +0300
+++ b/src/lib-http/http-client-connection.c Mon Sep 28 13:54:28 2015 +0300
@@ -1294,6 +1294,7 @@
void http_client_connection_ref(struct http_client_connection *conn)
{
+ i_assert(conn->refcount > 0);
conn->refcount++;
}
diff -r 77486e114423 -r c30c30c1e642 src/lib-http/http-client-request.c
--- a/src/lib-http/http-client-request.c Mon Sep 28 13:53:22 2015 +0300
+++ b/src/lib-http/http-client-request.c Mon Sep 28 13:54:28 2015 +0300
@@ -150,6 +150,7 @@
void http_client_request_ref(struct http_client_request *req)
{
+ i_assert(req->refcount > 0);
req->refcount++;
}
diff -r 77486e114423 -r c30c30c1e642 src/lib-http/http-server-connection.c
--- a/src/lib-http/http-server-connection.c Mon Sep 28 13:53:22 2015 +0300
+++ b/src/lib-http/http-server-connection.c Mon Sep 28 13:54:28 2015 +0300
@@ -831,6 +831,7 @@
void http_server_connection_ref(struct http_server_connection *conn)
{
+ i_assert(conn->refcount > 0);
conn->refcount++;
}
diff -r 77486e114423 -r c30c30c1e642 src/lib-http/http-server-request.c
--- a/src/lib-http/http-server-request.c Mon Sep 28 13:53:22 2015 +0300
+++ b/src/lib-http/http-server-request.c Mon Sep 28 13:54:28 2015 +0300
@@ -23,6 +23,7 @@
void http_server_request_ref(struct http_server_request *req)
{
+ i_assert(req->refcount > 0);
req->refcount++;
}
More information about the dovecot-cvs
mailing list