completed deallocation functions
I mean it worked fine, but now it sets strings to null etc.
This commit is contained in:
parent
e2eca1e3ea
commit
4ec8edafcb
@ -315,6 +315,14 @@ void deallocateOutput(outputFlags flags)
|
||||
{
|
||||
free(flags.outputText);
|
||||
free(flags.usedKey);
|
||||
|
||||
flags.elapsedTime = 0;
|
||||
flags.exitCode = SUCCESS;
|
||||
flags.repeatedKeySize = 0;
|
||||
flags.unusedKeySize = 0;
|
||||
|
||||
flags.outputText = NULL;
|
||||
flags.usedKey = NULL;
|
||||
}
|
||||
|
||||
boolean checkKey(char *key)
|
||||
|
@ -77,5 +77,6 @@ int main(void)
|
||||
free(usedKey);
|
||||
deallocateLogger(logger);
|
||||
deallocateDecryptedOutput(decrypted);
|
||||
|
||||
return exitCode;
|
||||
}
|
@ -33,6 +33,9 @@ void deallocateLogger(logFile logger)
|
||||
{
|
||||
close(logger.file);
|
||||
free(logger.fileName);
|
||||
|
||||
logger.fileName = NULL;
|
||||
logger.file = INVALID_FILE;
|
||||
}
|
||||
|
||||
void deallocateDecryptedOutput(decryptedOutput output)
|
||||
|
Loading…
x
Reference in New Issue
Block a user