323 |
/* pbuf references existing (externally allocated) RAM payload? */ |
/* pbuf references existing (externally allocated) RAM payload? */ |
324 |
case PBUF_REF: |
case PBUF_REF: |
325 |
/* only allocate memory for the pbuf structure */ |
/* only allocate memory for the pbuf structure */ |
326 |
p = memp_mallocp(MEMP_PBUF); |
p = memp_malloc(MEMP_PBUF); |
327 |
if (p == NULL) { |
if (p == NULL) { |
328 |
LWIP_DEBUGF(PBUF_DEBUG | DBG_TRACE | 2, ("pbuf_alloc: Could not allocate MEMP_PBUF for PBUF_%s.\n", flag == PBUF_ROM?"ROM":"REF")); |
LWIP_DEBUGF(PBUF_DEBUG | DBG_TRACE | 2, ("pbuf_alloc: Could not allocate MEMP_PBUF for PBUF_%s.\n", flag == PBUF_ROM?"ROM":"REF")); |
329 |
return NULL; |
return NULL; |
576 |
PBUF_POOL_FREE(p); |
PBUF_POOL_FREE(p); |
577 |
/* a ROM or RAM referencing pbuf */ |
/* a ROM or RAM referencing pbuf */ |
578 |
} else if (p->flags == PBUF_FLAG_ROM || p->flags == PBUF_FLAG_REF) { |
} else if (p->flags == PBUF_FLAG_ROM || p->flags == PBUF_FLAG_REF) { |
579 |
memp_freep(MEMP_PBUF, p); |
memp_free(MEMP_PBUF, p); |
580 |
/* p->flags == PBUF_FLAG_RAM */ |
/* p->flags == PBUF_FLAG_RAM */ |
581 |
} else { |
} else { |
582 |
mem_free(p); |
mem_free(p); |