defined deallocateDoublePointer

idk if it is safe, but it works heh
This commit is contained in:
Václav Šmejkal 2023-01-25 12:09:13 +01:00
parent 38ab5ac67d
commit abecff2c33
Signed by: ENGO150
GPG Key ID: F6D6DF86242C5A59

View File

@ -35,6 +35,23 @@ void deallocateLogger(logFile logger)
free(logger.fileName); free(logger.fileName);
} }
void deallocateDoublePointer(char **string)
{
int buffer = 0;
for (; 1; buffer++) //GET string SIZE (FIRST DIM)
{
if (!string[buffer]) break;
}
for (int i = 0; i < buffer; i++) //LOAD ELEMENTS
{
free(string[i]); //DEALLOCATE ELEMENTS
}
free(string); //no
}
char **decryptLogger(logFile logger) //TODO: Fix valgrind issues char **decryptLogger(logFile logger) //TODO: Fix valgrind issues
{ {
FILE *file = fdopen(logger.file, "r"); FILE *file = fdopen(logger.file, "r");