[zeromq-dev] patch: fix malloc/free mismatch in epoll

Dhammika Pathirana dhammika at gmail.com
Sun Mar 29 04:47:56 CEST 2009


Hi,

A one liner to fix malloc/free mismatch in epoll.
Not sure if we should add std::nothrow, we don't seem to be using it.

Dhammika
-------------- next part --------------
Index: epoll_thread.cpp
===================================================================
--- epoll_thread.cpp	(revision 1175)
+++ epoll_thread.cpp	(working copy)
@@ -43,7 +43,7 @@
 
 zmq::handle_t zmq::epoll_t::add_fd (fd_t fd_, i_pollable *engine_)
 {
-    poll_entry_t *pe = (poll_entry_t*) malloc (sizeof (poll_entry_t));
+    poll_entry_t *pe = new poll_entry_t;
     assert (pe != NULL);
 
     pe->fd = fd_;


More information about the zeromq-dev mailing list