Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: wakaama/liblwm2m.c
- Revision:
- 1:3549d3c3967c
- Parent:
- 0:f9d13e09cf11
- Child:
- 5:917e1705e5c2
--- a/wakaama/liblwm2m.c Mon Apr 24 23:03:31 2017 +0000
+++ b/wakaama/liblwm2m.c Fri Apr 28 08:16:22 2017 +0000
@@ -101,16 +101,18 @@
contextP->nextMID = rand();
#ifdef LWM2M_CLIENT_MODE
- contextP->endpointName = (char *)lwm2m_malloc(sizeof(endpointName));
-
- strcpy(contextP->endpointName,endpointName);
-
- //contextP->endpointName = strdup(endpointName);
+ contextP->endpointName = (char *)lwm2m_malloc(strlen(endpointName));
if (contextP->endpointName == NULL)
{
lwm2m_free(contextP);
return NULL;
}
+
+ strcpy(contextP->endpointName,endpointName);
+ printf("name: %s, %s, %d\n",endpointName,contextP->endpointName,strlen(endpointName));
+
+ //contextP->endpointName = strdup(endpointName);
+
if (numObject != 0)
{
contextP->objectList = (lwm2m_object_t **)lwm2m_malloc(numObject * sizeof(lwm2m_object_t *));
@@ -121,7 +123,7 @@
}
else
{
- //lwm2m_free(contextP->endpointName);
+ lwm2m_free(contextP->endpointName);
lwm2m_free(contextP);
return NULL;
}