diff --git a/01/src/main.c b/01/src/main.c index 165cafd..9602055 100644 --- a/01/src/main.c +++ b/01/src/main.c @@ -72,14 +72,14 @@ int main(int argc, char *argv[]) rewind(file); for (uint i = 0; i < lines; i++) { - char *buffer = NULL; - size_t bufferSize = 0; if (getline(&buffer, &bufferSize, file) == -1) break; sscanf(buffer, "%d %d", &array1[i], &array2[i]); } + free(buffer); + bufferSize = 0; fclose(file); qsort(array1, lines, sizeof(int), compareInt);