[Top][All Lists]

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

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

From: Pedro Alves
Subject: [lwip-users] fix assert triggered in tcp_in.c
Date: Thu, 06 Apr 2006 12:47:53 +0100
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

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.

Pedro Alves

reply via email to

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