lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] Closing connections with rawapi


From: Valery Ushakov
Subject: Re: [lwip-devel] Closing connections with rawapi
Date: Fri, 2 May 2014 20:17:43 +0000 (UTC)
User-agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (NetBSD/6.1_RC1 (macppc))

Per Knytt <address@hidden> wrote:

> What is the proper way to free an allocated pcb when tcp_connect()
> fails? I tried to use tcp_abort() since if tcp_connect() fails due to
> lack of memory then tcp_close() might fail for that reason as
> well. However, when tcp_connect() fails it leaves the pcb on
> tcp_bound_pcbs and tcp_abort() does not remove it from there, it just
> frees it, leading to invalid memory accesses down the line.
> 
> Is it unreasonable to use tcp_abort() to clean up from tcp_connect()
> failures or is this a bug?

>From source inspection, calling tcp_close() on a pcb that failed
tcp_connect() should be ok, since pcb remains in CLOSED state and
tcp_close() just drops the pcb from the bound list and frees the pcb.

-uwe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]