Skip to content

Commit dd07c52

Browse files
committed
Fix double free in NanostackInterface
When freeing all memory in the rx buffer chain set the head pointer to NULL. This prevents the head rx buffer from getting freed twice.
1 parent 9111aa4 commit dd07c52

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

features/net/FEATURE_IPV6/nanostack-interface/NanostackInterface.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ void NanostackSocket::data_free_all(void)
368368
// No mode requirement
369369

370370
NanostackBuffer *buffer = rxBufChain;
371+
rxBufChain = NULL;
371372
while (buffer != NULL) {
372373
NanostackBuffer *next_buffer = buffer->next;
373374
FREE(buffer);

0 commit comments

Comments
 (0)