import hypermatrix fixed again... 59/15359/3
Cedric Delamarre [Thu, 9 Oct 2014 14:44:52 +0000 (16:44 +0200)]
    * after commit https://codereview.scilab.org/#/c/15240/

test_run("hdf5", "exportImportHdf5","no_check_error_output")

Change-Id: I129b7e82b6342021026a028910ba45ade60ef05d

scilab/modules/hdf5/sci_gateway/cpp/sci_import_from_hdf5.cpp

index 5fc2982..b962b59 100644 (file)
@@ -1202,13 +1202,14 @@ static bool import_hypermat(int* pvCtx, int _iDatasetId, int _iVarType, int _iIt
     // get data of first item for check the type of mlist
     char** pstData = new char*[iSize];
     iRet = readStringMatrix(iItemDataset, pstData);
-    freeStringMatrix(iItemDataset, pstData);
     if (iRet || strcmp(pstData[0], "hm") != 0)
     {
+        freeStringMatrix(iItemDataset, pstData);
         delete[] pstData;
         return false;
     }
 
+    freeStringMatrix(iItemDataset, pstData);
     delete[] pstData;
     pstData = NULL;