chiark / gitweb /
do not leak prob when retrying
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 7 Mar 2014 18:43:49 +0000 (18:43 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 7 Mar 2014 18:43:49 +0000 (18:43 +0000)
main.c

diff --git a/main.c b/main.c
index 15b534b..b972460 100644 (file)
--- a/main.c
+++ b/main.c
@@ -52,6 +52,11 @@ static void optimise(int doprint) {
       if (!doprint) { doprint = 1; goto retry_with_print; }    \
     })
  retry_with_print:
+  if (prob) {
+    glp_delete_prob(prob);
+    prob = 0;
+  }
+
 #define PRINTF if (!doprint) ; else printf /* bodgy */
 
   PRINTF("%2d ", maxhamweight);