mirror of
https://gitlab.com/klmp200/fish.git
synced 2025-07-11 04:09:22 +00:00
En route vers le 0 leak memory
This commit is contained in:
@ -110,12 +110,11 @@ WordArray *wordListToWordArray(WordList *list) {
|
||||
if (array->words == NULL) crash();
|
||||
|
||||
while (current != NULL){
|
||||
array->words[i] = current->word;
|
||||
current->word = NULL;
|
||||
array->words[i] = strdup(current->word);
|
||||
current = current->next;
|
||||
i++;
|
||||
}
|
||||
array->words[i] = NULL;
|
||||
array->words[array->size] = NULL;
|
||||
}
|
||||
|
||||
freeWordList(list);
|
||||
@ -125,7 +124,7 @@ WordArray *wordListToWordArray(WordList *list) {
|
||||
|
||||
WordList *wordArrayToWordList(WordArray *array) {
|
||||
WordList *list = createWordList();
|
||||
int i = 0;
|
||||
int i;
|
||||
|
||||
for (i=0; i<array->size; i++)
|
||||
addWordList(list, array->words[i]);
|
||||
|
Reference in New Issue
Block a user