Commits

Ruslan Osmanov committed e3cafbe

Fix: segfault when calling bufferevent_socket_connect due to undefined size of sockaddr structure
Fix: call event_del() in API event_free()
Add: enable libevent's debugging mode when PHP_EVENT_DEBUG defined

Comments (0)

Files changed (1)

 		if (e->stream_id >= 0) { /* stdin fd == 0 */
 			zend_list_delete(e->stream_id);
 		}
+		event_del(e->event);
 		event_free(e->event);
 		efree(e);
 	}
 	 * logging to stderr, or calling abort()/exit() */
 	event_set_fatal_callback(fatal_error_cb);
 	event_set_log_callback(log_cb);
+#ifdef PHP_EVENT_DEBUG
+	event_enable_debug_mode();
+#endif
 
 	return SUCCESS;
 }
 	char               *addr;
 	int                 addr_len;
 	struct sockaddr     sa;
-	socklen_t           sa_len;
+	socklen_t           sa_len = sizeof(struct sockaddr);
 	zend_bool           sync_resolve = 0;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b",