From 4c887f0e1e850afb98b02dea6e90ebc7b98863e5 Mon Sep 17 00:00:00 2001 From: Dhruv Khattar Date: Fri, 12 Aug 2016 17:08:25 +0530 Subject: [PATCH] Coverity #731335, #1321204 fixed Change-Id: I236bf3020bd49dbc8dfa749ee6e89aafa0a65da8 --- scilab/modules/ast/src/cpp/parse/parsescilab.cpp | 2 ++ scilab/modules/ast/src/cpp/types/sparse.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scilab/modules/ast/src/cpp/parse/parsescilab.cpp b/scilab/modules/ast/src/cpp/parse/parsescilab.cpp index 8464479..8d129d3 100644 --- a/scilab/modules/ast/src/cpp/parse/parsescilab.cpp +++ b/scilab/modules/ast/src/cpp/parse/parsescilab.cpp @@ -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; } { diff --git a/scilab/modules/ast/src/cpp/types/sparse.cpp b/scilab/modules/ast/src/cpp/types/sparse.cpp index c891f90..275a075 100644 --- a/scilab/modules/ast/src/cpp/types/sparse.cpp +++ b/scilab/modules/ast/src/cpp/types/sparse.cpp @@ -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(pIdx[i] - 1) % getRows(); int iColRead = static_cast(pIdx[i] - 1) / getRows(); -- 1.7.9.5