Coverity #731335, #1321204 fixed 55/18455/3
Dhruv Khattar [Fri, 12 Aug 2016 11:38:25 +0000 (16:38 +0530)]
Change-Id: I236bf3020bd49dbc8dfa749ee6e89aafa0a65da8

scilab/modules/ast/src/cpp/parse/parsescilab.cpp
scilab/modules/ast/src/cpp/types/sparse.cpp

index 8464479..8d129d3 100644 (file)
@@ -2335,6 +2335,8 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
 # undef YYCASE_
+      default:
+        return 2;
     }
 
   {
index c891f90..275a075 100644 (file)
@@ -1700,7 +1700,10 @@ GenericType* Sparse::extract(typed_list* _pArgs)
                 {
                     delete pOut;
                     pOut = NULL;
-                    break;
+                    delete[] piMaxDim;
+                    delete[] piCountDim;
+                    cleanIndexesArguments(_pArgs, &pArg);
+                    return NULL;
                 }
                 int iRowRead = static_cast<int>(pIdx[i] - 1) % getRows();
                 int iColRead = static_cast<int>(pIdx[i] - 1) / getRows();