Scicos_blocks: fix memory leaks in tows_c 09/12909/2
Paul BIGNIER [Mon, 14 Oct 2013 10:47:18 +0000 (12:47 +0200)]
The allocated Integer matrices were not freed if something had gone wrong with their copying.

Change-Id: I86fa3b052e5b2d454862e1cdf60858d08796b9f8

scilab/modules/scicos_blocks/src/c/tows_c.c

index 0f2f43a..b2005ef 100644 (file)
@@ -1383,6 +1383,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
+                            scicos_free(MatInt8);
                             *(block->work) = NULL;
                             printError(&sciErr, 0);
                             return;
@@ -1411,6 +1412,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
+                            scicos_free(MatInt16);
                             *(block->work) = NULL;
                             printError(&sciErr, 0);
                             return;
@@ -1439,6 +1441,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
+                            scicos_free(MatInt32);
                             *(block->work) = NULL;
                             printError(&sciErr, 0);
                             return;
@@ -1467,6 +1470,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
+                            scicos_free(MatUInt8);
                             *(block->work) = NULL;
                             printError(&sciErr, 0);
                             return;
@@ -1495,6 +1499,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
+                            scicos_free(MatUInt16);
                             *(block->work) = NULL;
                             printError(&sciErr, 0);
                             return;
@@ -1523,6 +1528,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
+                            scicos_free(MatUInt32);
                             *(block->work) = NULL;
                             printError(&sciErr, 0);
                             return;