Commits

Anonymous committed 1e9dee1

if create/destroy_all_codes is called twice ignore the second call.

  • Participants
  • Parent commits 62e9e52

Comments (0)

Files changed (1)

 
 void m4ri_destroy_all_codes() {
   int i;
+  if (!codebook) {
+    return;
+  }
   for(i=1; i<MAXKAY+1; i++) {
     m4ri_mm_free(codebook[i]->inc);
     m4ri_mm_free(codebook[i]->ord);
     m4ri_mm_free(codebook[i]);
   }
   m4ri_mm_free(codebook);
+  codebook = NULL;
 }
 
 static int log2_floor(int n){