Skip to content

Commit

Permalink
Merge pull request eclipse-wakaama#412 from tgagneret-embedded/fix/me…
Browse files Browse the repository at this point in the history
…mory_allocation_issue

Fix/memory allocation issue
  • Loading branch information
dnav committed Feb 14, 2019
2 parents 8662d9f + 48a0299 commit 7c13b1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/shared/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ connection_t * connection_new_incoming(connection_t * connList,
{
connection_t * connP;

connP = (connection_t *)malloc(sizeof(connection_t));
connP = (connection_t *)lwm2m_malloc(sizeof(connection_t));
if (connP != NULL)
{
connP->sock = sock;
Expand Down Expand Up @@ -140,7 +140,7 @@ connection_t * connection_create(connection_t * connList,
close(s);
}
if (NULL != servinfo) {
free(servinfo);
freeaddrinfo(servinfo);
}

return connP;
Expand All @@ -153,7 +153,7 @@ void connection_free(connection_t * connList)
connection_t * nextP;

nextP = connList->next;
free(connList);
lwm2m_free(connList);

connList = nextP;
}
Expand Down

0 comments on commit 7c13b1b

Please sign in to comment.