From fe26418374b5c4a3fabaafe48fa38d5f205aab84 Mon Sep 17 00:00:00 2001 From: Brian Taylor Date: Thu, 29 Jun 2023 17:43:34 -0700 Subject: [PATCH] Fix the Cider memory leaks from setupContacts. TWOdestroy needed to free the contact nodes. --- src/ciderlib/twod/twodest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ciderlib/twod/twodest.c b/src/ciderlib/twod/twodest.c index 2466eea44..6294b852d 100644 --- a/src/ciderlib/twod/twodest.c +++ b/src/ciderlib/twod/twodest.c @@ -85,6 +85,9 @@ TWOdestroy(TWOdevice *pDevice) struct sTWOcontact* pFCtmp = pDevice->pFirstContact; while (pFCtmp) { struct sTWOcontact* pFCtmpnext = pFCtmp->next; + if (pFCtmp->pNodes) { + FREE(pFCtmp->pNodes); + } FREE(pFCtmp); pFCtmp = pFCtmpnext; }