Changeset: 5b2c69dc1d8d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5b2c69dc1d8d
Modified Files:
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_parser.c
        monetdb5/modules/mal/mal_mapi.c
        monetdb5/modules/mal/tablet.c
        monetdb5/scheduler/run_adder.c
        sql/backends/monet5/UDF/pyapi/pyapi.c
        sql/backends/monet5/sql_optimizer.c
        sql/server/sql_atom.c
Branch: linear-hashing
Log Message:

Several smaller Coverity fixes.


diffs (101 lines):

diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -763,7 +763,7 @@ str runMALsequence(Client cntxt, MalBlkP
                                        } else if (lhs->vtype == TYPE_bat)
                                                BBPretain(lhs->val.bval);
                                }
-                               if(ret == MAL_SUCCEED) {
+                               if(ret == MAL_SUCCEED  && ii == pci->argc) {
                                        ret = runMALsequence(cntxt, pci->blk, 
1, pci->blk->stop, nstk, stk, pci);
                                        for (ii = 0; ii < nstk->stktop; ii++)
                                                if 
(ATOMextern(nstk->stk[ii].vtype))
diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -1474,9 +1474,12 @@ parseEnd(Client cntxt)
                } else {
                        str msg;
                        if((msg = 
MSinitClientPrg(cntxt,cntxt->curmodule->name,"main")) != MAL_SUCCEED) {
-                               if(!errors)
+                               if(!msg){
                                        cntxt->curprg->def->errors = msg;
-                               else
+                                       GDKfree(errors);
+                               } else if(!errors){
+                                       cntxt->curprg->def->errors = errors;
+                               } else
                                        freeException(msg);
                                return 1;
                        }
diff --git a/monetdb5/modules/mal/mal_mapi.c b/monetdb5/modules/mal/mal_mapi.c
--- a/monetdb5/modules/mal/mal_mapi.c
+++ b/monetdb5/modules/mal/mal_mapi.c
@@ -424,6 +424,7 @@ SERVERlistenThread(SOCKET *Sock)
                        msgh.msg_namelen = 0;
                        msgh.msg_iov = &iov;
                        msgh.msg_iovlen = 1;
+                       msgh.msg_flags = 0;
                        msgh.msg_control = ccmsg;
                        msgh.msg_controllen = sizeof(ccmsg);
 
diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -898,6 +898,7 @@ SQLinsert_val(READERtask *task, int col,
                }
                ret = -!task->besteffort; /* yep, two unary operators ;-) */
                freeException(err);
+               err = NULL;
                /* replace it with a nil */
                adt = fmt->nildata;
                fmt->c->tnonil = false;
diff --git a/monetdb5/scheduler/run_adder.c b/monetdb5/scheduler/run_adder.c
--- a/monetdb5/scheduler/run_adder.c
+++ b/monetdb5/scheduler/run_adder.c
@@ -72,7 +72,7 @@ RUNadder(Client cntxt, MalBlkPtr mb, Mal
        int batch;
        int size;
        int i,pc;
-       InstrPtr q, *old;
+       InstrPtr q =  NULL, *old;
        int oldtop;
        str msg = MAL_SUCCEED;
 
diff --git a/sql/backends/monet5/UDF/pyapi/pyapi.c 
b/sql/backends/monet5/UDF/pyapi/pyapi.c
--- a/sql/backends/monet5/UDF/pyapi/pyapi.c
+++ b/sql/backends/monet5/UDF/pyapi/pyapi.c
@@ -143,7 +143,7 @@ PYFUNCNAME(PyAPIevalAggrMap)(Client cntx
 //! If 'mapped' is set to True, it will fork a separate process at 
[FORK_PROCESS] that executes Step 1-3, the process will then write the return 
values into memory mapped files and exit, then Step 4 is executed by the main 
process
 static str PyAPIeval(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, 
bool grouped, bool mapped) {
        sql_func * sqlfun = NULL;
-       str exprStr;
+       str exprStr = NULL;
 
        const int additional_columns = 3;
        int i = 1, ai = 0;
diff --git a/sql/backends/monet5/sql_optimizer.c 
b/sql/backends/monet5/sql_optimizer.c
--- a/sql/backends/monet5/sql_optimizer.c
+++ b/sql/backends/monet5/sql_optimizer.c
@@ -262,7 +262,9 @@ SQLoptimizeQuery(Client c, MalBlkPtr mb)
                        freeException(msg);
                        msg = MAL_SUCCEED;
                }
-               return createException(MAL, "optimizer.optimizeQuery", "%s", 
mb->errors ? mb->errors : msg);
+               str nmsg = createException(MAL, "optimizer.optimizeQuery", 
"%s", mb->errors ? mb->errors : msg);
+               freeException(msg);
+               return nmsg;
        }
 
        pipe = getSQLoptimizer(be->mvc);
diff --git a/sql/server/sql_atom.c b/sql/server/sql_atom.c
--- a/sql/server/sql_atom.c
+++ b/sql/server/sql_atom.c
@@ -1171,6 +1171,7 @@ int
 atom_neg( atom *a )
 {
        ValRecord dst;
+       VALempty(&dst);
        dst.vtype = a->data.vtype;
        if (VARcalcnegate(&dst, &a->data) != GDK_SUCCEED)
                return -1;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to