lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] fix assert triggered in tcp_in.c


From: Pedro Alves
Subject: Re: [lwip-users] fix assert triggered in tcp_in.c
Date: Fri, 07 Apr 2006 14:51:30 +0100
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)


Jan Ulvesten wrote:

Seems to me that you fixed a dangling pointer bug.
Yep, that's right. Any change of getting it into cvs?

Cheers,
Pedro Alves



-----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



_______________________________________________
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]