[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] Small fix for 'minimal'
From: |
John Jannotti |
Subject: |
[lwip-devel] Small fix for 'minimal' |
Date: |
Wed, 21 Sep 2005 20:56:16 -0000 |
The 'minimal' project in contrib was very helpful to get started with
lwip, but I believe there is a small bug. In echo.c, in close_conn,
there is an attempt to pbuf_free(es->p) unconditionally. but normally
p is null because es has nothing pending to send. Here is my diff,
which corrects the same thing in another spot, and a cut and paste
error in a comment.
jj
Index: echo.c
===================================================================
RCS file: /cvsroot/lwip/contrib/ports/unix/proj/minimal/echo.c,v
retrieving revision 1.2
diff -u -r1.2 echo.c
--- echo.c 1 May 2003 13:27:53 -0000 1.2
+++ echo.c 21 Sep 2005 20:42:57 -0000
@@ -46,7 +46,7 @@
struct echo_state *es = arg;
if (arg != NULL) {
- pbuf_free(es->p);
+ if (es->p) pbuf_free(es->p);
mem_free(arg);
}
}
@@ -60,7 +60,7 @@
tcp_recv(pcb, NULL);
#endif /* 0 */
if (es != NULL) {
- pbuf_free(es->p);
+ if (es->p) pbuf_free(es->p);
mem_free(es);
}
tcp_close(pcb);
@@ -168,7 +168,7 @@
tcp_arg(pcb, es);
/* Tell TCP that we wish to be informed of incoming data by a call
- to the http_recv() function. */
+ to the echo_recv() function. */
#if 0
tcp_recv(pcb, echo_recv);
zsh: exit 1 cvs diff -u
- [lwip-devel] Small fix for 'minimal',
John Jannotti <=