From: Sven Verdoolaege Date: Sat, 26 Mar 2011 17:00:26 +0000 (+0100) Subject: isl_tab: alway free saved basis undo record X-Git-Tag: isl-0.07~29^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff9f2421cea7be2440bc08210b812b36f00c7d89;p=platform%2Fupstream%2Fisl.git isl_tab: alway free saved basis undo record Before, it would only get freed if it was actually used. Signed-off-by: Sven Verdoolaege --- diff --git a/isl_tab.c b/isl_tab.c index f418517..28af80e 100644 --- a/isl_tab.c +++ b/isl_tab.c @@ -172,13 +172,24 @@ struct isl_tab *isl_tab_extend(struct isl_tab *tab, unsigned n_new) 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; } @@ -3010,11 +3021,9 @@ static int restore_basis(struct isl_tab *tab, int *col_var) } free(extra); - free(col_var); return 0; error: free(extra); - free(col_var); return -1; } @@ -3103,7 +3112,7 @@ int isl_tab_rollback(struct isl_tab *tab, struct isl_tab_undo *snap) tab->in_undo = 0; return -1; } - free(undo); + free_undo_record(undo); } tab->in_undo = 0; tab->top = undo;