Before, it would only get freed if it was actually used.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
return NULL;
}
+static void free_undo_record(struct isl_tab_undo *undo)
+{
+ switch (undo->type) {
+ case isl_tab_undo_saved_basis:
+ free(undo->u.col_var);
+ break;
+ default:;
+ }
+ free(undo);
+}
+
static void free_undo(struct isl_tab *tab)
{
struct isl_tab_undo *undo, *next;
for (undo = tab->top; undo && undo != &tab->bottom; undo = next) {
next = undo->next;
- free(undo);
+ free_undo_record(undo);
}
tab->top = undo;
}
}
free(extra);
- free(col_var);
return 0;
error:
free(extra);
- free(col_var);
return -1;
}
tab->in_undo = 0;
return -1;
}
- free(undo);
+ free_undo_record(undo);
}
tab->in_undo = 0;
tab->top = undo;