lwip-users
[Top][All Lists]
Advanced

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

RE: SPAM? [lwip-users] fix assert triggered in tcp_in.c


From: Jan Ulvesten
Subject: RE: SPAM? [lwip-users] fix assert triggered in tcp_in.c
Date: Fri, 7 Apr 2006 09:47:39 +0200

Seems to me that you fixed a dangling pointer bug.
 

-----Original Message-----
From: Pedro Alves [mailto:address@hidden 
Sent: 6. april 2006 13:48
To: address@hidden
Subject: SPAM? [lwip-users] fix assert triggered in tcp_in.c

Hi all,

I was getting a few assertions in pbuf_free call about the ref count 
being 0.

The following (hand made) patch fixed it.

In tcp_in.c around where it says:

    /* We deallocate the incoming pbuf. If it was buffered by the
       application, the application should have called pbuf_ref() to
       increase the reference counter in the pbuf. If so, the buffer
       isn't actually deallocated by the call to pbuf_free(), only the
       reference count is decreased. */
-    if (inseg.p != NULL) pbuf_free(inseg.p);
+    if (inseg.p != NULL) {
+    pbuf_free(inseg.p);
+      inseg.p = NULL;
+    }


I have been testing it for a few days, and found no problem.

Cheers,
Pedro Alves



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

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