Skip to content

Commit

Permalink
Change recursion to iteration to reduce stack usage.
Browse files Browse the repository at this point in the history
Signed-off-by: Achim Kraus <achim.kraus@bosch-si.com>
  • Loading branch information
Achim Kraus committed Apr 20, 2015
1 parent 55d140b commit f5d1a61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/utils/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ connection_t * connection_create(connection_t * connList,

void connection_free(connection_t * connList)
{
if (connList != NULL)
while (connList != NULL)
{
connection_t * nextP;

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

connection_free(nextP);
connList = nextP;
}
}

Expand Down

0 comments on commit f5d1a61

Please sign in to comment.