From 50261fd0feed33ac769ec8f54ea2cd8b17192ba9 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Mon, 5 Oct 2020 09:31:58 -0500 Subject: Attempt to work on #5. Blank files are made and free doesn't work still --- P1/src/mapper.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'P1') diff --git a/P1/src/mapper.c b/P1/src/mapper.c index e430bb3..f234859 100644 --- a/P1/src/mapper.c +++ b/P1/src/mapper.c @@ -66,15 +66,15 @@ intermediateDS *insertPairToInterDS(intermediateDS *root, char *word, char *coun // free the DS after usage. Call this once you are done with the writing of DS into file void freeInterDS(intermediateDS *root) { -if(root == NULL) return; - -intermediateDS *tempNode = NULL; -while (root != NULL){ -tempNode = root; -root = root -> next; -freeValueList(tempNode -> value); -free(tempNode); -} + if(root == NULL) return; + + intermediateDS *tempNode = NULL; + while (root != NULL){ + tempNode = root; + root = root -> next; + freeValueList(tempNode -> value); + free(tempNode); + } } // emit the into intermediate DS @@ -121,7 +121,7 @@ void writeIntermediateDS() { fclose(fptr); tempNode = tempNode -> next; } - //freeInterDS(root); + freeInterDS(root); } int main(int argc, char *argv[]) { -- cgit v1.2.3