Commit 05b12aff authored by Caleb C. Sander's avatar Caleb C. Sander
Browse files

Add missing free()s

parent a37ba771
No related merge requests found
Showing with 7 additions and 15 deletions
+7 -15
#include <inttypes.h> const char SECRET[] = "CLOCK";
#include <stdlib.h>
#include <string.h>
char *SECRET = "CLOCK";
static inline char access_secret(size_t i) { static inline char access_secret(size_t i) {
return SECRET[i]; return SECRET[i];
......
...@@ -34,4 +34,5 @@ int main() { ...@@ -34,4 +34,5 @@ int main() {
if (guess > 0) { if (guess > 0) {
printf("%zu\n", guess); printf("%zu\n", guess);
} }
free(pages);
} }
#include <inttypes.h>
#include <stdbool.h>
#include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "util.h" #include "util.h"
#include "stage3.h" #include "stage3.h"
const uint64_t MIN_CHOICE = 'A' - 1; const size_t MIN_CHOICE = 'A' - 1;
const uint64_t MAX_CHOICE = 'Z' + 1; const size_t MAX_CHOICE = 'Z' + 1;
const uint64_t SECRET_LENGTH = 5; const size_t SECRET_LENGTH = 5;
static inline page_t *init_pages() { static inline page_t *init_pages(void) {
return calloc(MAX_CHOICE, sizeof(page_t)); return calloc(MAX_CHOICE, sizeof(page_t));
} }
...@@ -37,4 +32,5 @@ int main() { ...@@ -37,4 +32,5 @@ int main() {
// TODO: Copy me from the previous stage and edit me so I loop over SECRET_LENGTH characters. // TODO: Copy me from the previous stage and edit me so I loop over SECRET_LENGTH characters.
printf("\n"); printf("\n");
free(probe_array);
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment