From 51465188daa66d3997a67afc9e017c032c2c7e2d Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Thu, 24 Jan 2013 16:14:56 +0100 Subject: l2tp: Close tunnel handler's FD if TID assignment fails Use l2tp_tunnel_alloc() cleanup code for handling TID assignment failure. The previous manual cleanup did not close the triton handler file descriptor. Signed-off-by: Guillaume Nault --- accel-pppd/ctrl/l2tp/l2tp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index b2447cd6..1534c9e9 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -624,8 +624,7 @@ static int l2tp_tunnel_alloc(struct l2tp_serv_t *serv, struct l2tp_packet_t *pac if (!conn->tid) { if (conf_verbose) log_warn("l2tp: no free tid available\n"); - mempool_free(conn); - return -1; + goto out_err; } memcpy(&conn->lac_addr, &pack->addr, sizeof(pack->addr)); -- cgit v1.2.3