Compare commits

..

2 Commits

Author SHA1 Message Date
fddf7ab780
fix(01): Fix memory leaks 2024-12-03 14:20:43 +01:00
ab4e7a7edb
feat(nix): Add valgrind 2024-12-03 14:19:51 +01:00
2 changed files with 4 additions and 3 deletions

@ -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);

@ -4,9 +4,10 @@ in
pkgs.mkShell {
packages = with pkgs; [
# Choose the build tools that you need
cmake
gcc
gdb
cmake
valgrind
];
}