Add mbuf documentation. have mbuf_free handle NULL pointer
This commit is contained in:
+7
-5
@@ -86,11 +86,13 @@ struct MBuf *uc_mbuf_new_inline_hr(uint32_t len, uint32_t headroom)
|
||||
|
||||
void uc_mbuf_free(struct MBuf *mbuf)
|
||||
{
|
||||
if (mbuf->flags & (UC_MBUF_FL_MALLOC | UC_MBUF_FL_MALLOC_BUF))
|
||||
free(mbuf->bufstart);
|
||||
|
||||
if (mbuf->flags & (UC_MBUF_FL_MALLOC | UC_MBUF_FL_MALLOC_INLINE))
|
||||
free(mbuf);
|
||||
if (mbuf != NULL) {
|
||||
if (mbuf->flags & (UC_MBUF_FL_MALLOC | UC_MBUF_FL_MALLOC_BUF))
|
||||
free(mbuf->bufstart);
|
||||
|
||||
if (mbuf->flags & (UC_MBUF_FL_MALLOC | UC_MBUF_FL_MALLOC_INLINE))
|
||||
free(mbuf);
|
||||
}
|
||||
}
|
||||
|
||||
void uc_mbuf_zero(struct MBuf *mbuf)
|
||||
|
||||
Reference in New Issue
Block a user