[dovecot-cvs] dovecot/src/util rawlog.c,1.6,1.7

cras at dovecot.org cras at dovecot.org
Sat Jan 14 20:48:22 EET 2006


Update of /var/lib/cvs/dovecot/src/util
In directory talvi:/tmp/cvs-serv16037/util

Modified Files:
	rawlog.c 
Log Message:
deinit, unref, destroy, close, free, etc. functions now take a pointer to
their data pointer, and set it to NULL. This makes double-frees less likely
to cause security holes.



Index: rawlog.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/util/rawlog.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- rawlog.c	13 Jan 2006 20:26:53 -0000	1.6
+++ rawlog.c	14 Jan 2006 18:48:18 -0000	1.7
@@ -48,13 +48,13 @@
 			i_error("close(out) failed: %m");
 	}
 	if (proxy->client_io != NULL)
-		io_remove(proxy->client_io);
+		io_remove(&proxy->client_io);
 	if (proxy->server_io != NULL)
-		io_remove(proxy->server_io);
+		io_remove(&proxy->server_io);
 
-	i_stream_unref(proxy->server_input);
-	o_stream_unref(proxy->client_output);
-	o_stream_unref(proxy->server_output);
+	i_stream_unref(&proxy->server_input);
+	o_stream_unref(&proxy->client_output);
+	o_stream_unref(&proxy->server_output);
 
 	if (close(proxy->client_in_fd) < 0)
 		i_error("close(client_in_fd) failed: %m");
@@ -121,8 +121,7 @@
 	    OUTBUF_THRESHOLD) {
 		/* client's output buffer is already quite full.
 		   don't send more until we're below threshold. */
-		io_remove(proxy->server_io);
-		proxy->server_io = NULL;
+		io_remove(&proxy->server_io);
 		return;
 	}
 
@@ -144,8 +143,7 @@
 	    OUTBUF_THRESHOLD) {
 		/* proxy's output buffer is already quite full.
 		   don't send more until we're below threshold. */
-		io_remove(proxy->client_io);
-		proxy->client_io = NULL;
+		io_remove(&proxy->client_io);
 		return;
 	}
 
@@ -309,7 +307,7 @@
 	ioloop = io_loop_create(system_pool);
 	rawlog_proxy_create(0, 1, sfd[0], path, write_timestamps);
 	io_loop_run(ioloop);
-	io_loop_destroy(ioloop);
+	io_loop_destroy(&ioloop);
 
 	lib_deinit();
 	exit(0);



More information about the dovecot-cvs mailing list