Set q to NULL after freeing it before returning: cleaner code!

This commit is contained in:
goldsimon 2007-06-04 10:42:03 +00:00
parent 9209a2ee33
commit 3a429eabcd

View File

@ -378,6 +378,7 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p)
if (q != p) { if (q != p) {
/* free the header pbuf */ /* free the header pbuf */
pbuf_free(q); pbuf_free(q);
q = NULL;
/* p is still referenced by the caller, and will live on */ /* p is still referenced by the caller, and will live on */
} }
return ERR_VAL; return ERR_VAL;