Commits

Greg Ward committed c92bd96

Make valgrind happy.

Comments (0)

Files changed (2)

 
-CFLAGS = -Wall -Wextra -Wno-unused-parameter -std=gnu99 -g -O2
+CFLAGS = -Wall -Wextra -Wno-unused-parameter -std=gnu99 -g
 
 headers = $(wildcard src/*.h)
 sources = $(wildcard src/*.c)
 int
 main(int argc, char** argv)
 {
+    int status = 0;
+
     /* Establish a handler for SIGALRM signals.  */
     signal(SIGALRM, exit_on_alarm);
 
 
     /* Nobody claimed it: bail now without printing anything. */
     if (context == NULL) {
-        return 0;
+        goto done;
     }
 
     /* Analyze the working copy metadata and print the result. */
         if (options.debug)
             putc('\n', stdout);
     }
-    return 0;
+
+ done:
+    for (int i = 0; i < num_contexts; i++) {
+        free(contexts[i]);
+    }
+    return status;
 }