diff --git a/challenge/challenge.c b/challenge/challenge.c index 938029b..05d3f12 100644 --- a/challenge/challenge.c +++ b/challenge/challenge.c @@ -14,15 +14,18 @@ int main(void) { /* read in password from standard input, exit on error. */ if (getline(&input_line, &input_size, stdin) == -1) { perror("Error"); + free(input_line); exit(EXIT_FAILURE); } /* compare password, print info, exit appropriately */ if (strcmp(input_line, password) == 0) { puts("Success!"); + free(input_line); exit(EXIT_SUCCESS); } else { puts("How about no?!"); + free(input_line); exit(EXIT_FAILURE); } }