diff --git a/src/core/pbuf.c b/src/core/pbuf.c index 73e4e6f4..51ae6f5a 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -599,7 +599,7 @@ pbuf_free(struct pbuf *p) /* all pbufs in a chain are referenced at least once */ LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0); /* decrease reference count (number of pointers to pbuf) */ - ref = p->ref--; + ref = --(p->ref); SYS_ARCH_UNPROTECT(old_level); /* this pbuf is no longer referenced to? */ if (ref == 0) {