Coverity #731335, #1321204 fixed
[scilab.git] / scilab / modules / ast / src / cpp / types / sparse.cpp
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();