Changeset: 77026eeec7ba for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=77026eeec7ba
Modified Files:
        monetdb5/optimizer/opt_constants.c
Branch: default
Log Message:

Improve test coverage


diffs (38 lines):

diff --git a/monetdb5/optimizer/opt_constants.c 
b/monetdb5/optimizer/opt_constants.c
--- a/monetdb5/optimizer/opt_constants.c
+++ b/monetdb5/optimizer/opt_constants.c
@@ -37,12 +37,8 @@ OPTconstantsImplementation(Client cntxt,
        cst= (VarPtr*) GDKzalloc(sizeof(VarPtr) * mb->vtop);
        index= (int*) GDKzalloc(sizeof(int) * mb->vtop);
 
-       if ( alias == NULL || cst == NULL || index == NULL){
-               if( alias) GDKfree(alias);
-               if( cst) GDKfree(cst);
-               if( index) GDKfree(index);
-               return 0;
-       }
+       if ( alias == NULL || cst == NULL || index == NULL)
+               goto wrapup;
 
        (void) stk;
        (void) cntxt;
@@ -86,9 +82,6 @@ OPTconstantsImplementation(Client cntxt,
                        for (k=0; k < p->argc; k++)
                                getArg(p,k) = alias[getArg(p,k)];
                }
-       GDKfree(alias);
-       GDKfree(cst);
-       GDKfree(index);
     /* Defense line against incorrect plans */
        /* Plan remains unaffected */
        //chkTypes(cntxt->fdout, cntxt->nspace, mb, FALSE);
@@ -99,5 +92,9 @@ OPTconstantsImplementation(Client cntxt,
     snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " 
usec","constants",actions,GDKusec() - usec);
     newComment(mb,buf);
 
+wrapup:
+       if( alias) GDKfree(alias);
+       if( cst) GDKfree(cst);
+       if( index) GDKfree(index);
        return actions;
 }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to