Menu

#29 Memory leak in coap_delete_attr in resource.c

v5.0
closed-rejected
None
5
2015-02-12
2014-12-02
NMacs
No

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);

ifdef POSIX

coap_free(attr);

endif

ifdef WITH_LWIP

memp_free(MEMP_COAP_RESOURCEATTR, attr);

endif

ifdef WITH_CONTIKI

/ FIXME it looks like this was never implemented /

endif

}

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);

ifdef WITH_POSIX

coap_free(attr);

endif

ifdef WITH_LWIP

memp_free(MEMP_COAP_RESOURCEATTR, attr);

endif

ifdef WITH_CONTIKI

/ FIXME it looks like this was never implemented /

endif

}

Discussion

  • Olaf Bergmann

    Olaf Bergmann - 2014-12-05
    • status: open --> closed-rejected
     
  • Olaf Bergmann

    Olaf Bergmann - 2014-12-05

    Thank you. I closed this bug as rejected because it has already been fixed in branch master by commit 234cf4e of Apr 4, 2014.

     
Monday.com Logo