poll_add() in libevent 1.1b and current CVS (revision 1.2) leaks memory on realloc() failure. I've attached an untested patch to instead preserve the existing contents of the array while still returning error. All other libevent uses of realloc() look fine to me.

By the way, what's the rationale for the separate event_[rw]_back structures and for the idxplus1_by_fd? It seems like the former could be combined into a single event_back and the latter replaced with a new member of struct event for arbitrary use by the event_op. I ask because I'm porting libevent to a platform that needs a proprietary extra POLLxxx event type, and it seems preferable to remove two of four dynamically-allocated parallel arrays instead of adding a fifth.

Best regards,
Scott

--
Scott Lamb <http://www.slamb.org/>

Attachment: event-poll-leak.patch
Description: Binary data


_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to