1.1 --- a/suffix_list.c Tue Sep 20 15:19:28 2011 +0200 1.2 +++ b/suffix_list.c Thu Oct 06 00:06:30 2011 +0200 1.3 @@ -15,9 +15,16 @@ 1.4 return suffixList; 1.5 } 1.6 1.7 +void destroy_suffix_list_t(suffix_list_t* list) { 1.8 + if (list->items != NULL) { 1.9 + free(list->items); 1.10 + } 1.11 + free(list); 1.12 +} 1.13 + 1.14 void add_suffix(suffix_list_t* list, char* item) { 1.15 char** reallocated_list = 1.16 - realloc(list->items, sizeof(char*) * list->count + 1); 1.17 + realloc(list->items, sizeof(char*) * (list->count + 1)); 1.18 if (reallocated_list != NULL) { 1.19 list->items = reallocated_list; 1.20 list->items[list->count] = item;