From e4a2986c12f48063c6802e5288983b1357137aed Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Tue, 24 May 2022 18:09:35 +0200 Subject: [PATCH] made test failure memory safe --- src/lib/test/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/test/main.c b/src/lib/test/main.c index 1308e56..6c02a77 100644 --- a/src/lib/test/main.c +++ b/src/lib/test/main.c @@ -7,6 +7,7 @@ int main(void) { char *buffer = malloc(64); + int exitCode = 0; inputFlags flags = { @@ -27,12 +28,12 @@ int main(void) else { fprintf(stderr, "Test failed!\n"); - exit(1); + exitCode = 1; } //DEALLOCATION free(buffer); deallocateOutput(encrypted); - return 0; + return exitCode; }