Memory leak in coap_delete_attr in resource.c
Status: Beta
Brought to you by:
obgm
Seams to be a bug in POSIX environment.
void
coap_delete_attr(coap_attr_t *attr) {
if (!attr)
return;
if (attr->flags & COAP_ATTR_FLAGS_RELEASE_NAME)
coap_free(attr->name.s);
if (attr->flags & COAP_ATTR_FLAGS_RELEASE_VALUE)
coap_free(attr->value.s);
coap_free(attr);
memp_free(MEMP_COAP_RESOURCEATTR, attr);
/ FIXME it looks like this was never implemented /
}
should be:
void
coap_delete_attr(coap_attr_t *attr) {
if (!attr)
return;
if (attr->flags & COAP_ATTR_FLAGS_RELEASE_NAME)
coap_free(attr->name.s);
if (attr->flags & COAP_ATTR_FLAGS_RELEASE_VALUE)
coap_free(attr->value.s);
coap_free(attr);
memp_free(MEMP_COAP_RESOURCEATTR, attr);
/ FIXME it looks like this was never implemented /
}
Thank you. I closed this bug as rejected because it has already been fixed in branch master by commit 234cf4e of Apr 4, 2014.