From 3a429eabcdebb7d4abc053c59e0c93061b4c63a4 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Mon, 4 Jun 2007 10:42:03 +0000 Subject: [PATCH] Set q to NULL after freeing it before returning: cleaner code! --- src/core/udp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/udp.c b/src/core/udp.c index 47a224b3..fbfdb00c 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -378,6 +378,7 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p) if (q != p) { /* free the header pbuf */ pbuf_free(q); + q = NULL; /* p is still referenced by the caller, and will live on */ } return ERR_VAL;