Coverity #1320928, #1320929 fixed 59/18459/4
Dhruv Khattar [Sun, 14 Aug 2016 06:51:29 +0000 (11:51 +0530)]
Change-Id: I2077921656ac524b0ea015348232ab218e59fc50

scilab/modules/hdf5/sci_gateway/cpp/sci_hdf5_load_v2.cpp

index 8d70374..8016883 100644 (file)
@@ -391,6 +391,16 @@ static bool import_double(int* pvCtx, int _iDatasetId, int _iItemPos, int *_piAd
             {
                 iRet = readDoubleMatrix(_iDatasetId, pdblReal);
             }
+            if (iRet < 0)
+            {
+                FREE(piDims);
+                FREE(pdblReal);
+                if (iComplex)
+                {
+                    FREE(pdblImg);
+                }
+                return false;
+            }
 
             //to be sure ti have 2 dims
             if (iDims == 1)