isl_tab_pip.c: add_parametric_cut: plug memory leak on error path
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 30 Nov 2012 23:29:56 +0000 (00:29 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 1 Dec 2012 16:38:07 +0000 (17:38 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_tab_pip.c

index 3f6673f..f131ccf 100644 (file)
@@ -1958,6 +1958,7 @@ static int add_parametric_cut(struct isl_tab *tab, int row,
 
        n = tab->n_div;
        d = context->op->get_div(context, tab, div);
+       isl_vec_free(div);
        if (d < 0)
                return -1;
 
@@ -2023,8 +2024,6 @@ static int add_parametric_cut(struct isl_tab *tab, int row,
        if (tab->row_sign)
                tab->row_sign[tab->con[r].index] = isl_tab_row_neg;
 
-       isl_vec_free(div);
-
        row = tab->con[r].index;
 
        if (d >= n && context->op->detect_equalities(context, tab) < 0)