summaryrefslogtreecommitdiff
path: root/lib/udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/udp.c')
-rw-r--r--lib/udp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/udp.c b/lib/udp.c
index 911616d..c04821d 100644
--- a/lib/udp.c
+++ b/lib/udp.c
@@ -155,7 +155,10 @@ udp_init (struct rs_connection *conn, struct rs_packet *pkt)
if (!conn->rev || !conn->wev)
{
if (conn->rev)
- event_free (conn->rev);
+ {
+ event_free (conn->rev);
+ conn->rev = NULL;
+ }
/* ENOMEM _or_ EINVAL but EINVAL only if we use EV_SIGNAL, at
least for now (libevent-2.0.5). */
return rs_err_conn_push_fl (conn, RSE_NOMEM, __FILE__, __LINE__, NULL);