aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--P1/src/mapper.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/P1/src/mapper.c b/P1/src/mapper.c
index f234859..0fd6198 100644
--- a/P1/src/mapper.c
+++ b/P1/src/mapper.c
@@ -23,14 +23,14 @@ valueList *insertNewValueToList(valueList *root, char *count){
// free value list
void freeValueList(valueList *root) {
-if(root == NULL) return;
+ if(root == NULL) return;
-valueList *tempNode = NULL;
-while (root != NULL){
-tempNode = root;
-root = root -> next;
-free(tempNode);
-}
+ valueList *tempNode = NULL;
+ while (root != NULL){
+ tempNode = root;
+ root = root -> next;
+ free(tempNode);
+ }
}
// create <word, value list>
@@ -73,6 +73,8 @@ void freeInterDS(intermediateDS *root) {
tempNode = root;
root = root -> next;
freeValueList(tempNode -> value);
+ //THIS FREE BREAKS ONCE PER PROCESS
+ //WILL PROBABLY BE FIXED IF THE EMPTY FILES PROBLEM GETS FIXED
free(tempNode);
}
}