fixe csvRead_regexp and bug_12140 : NULL addressing for pwstLines after free 40/15740/4
Sylvain GENIN [Tue, 6 Jan 2015 08:55:49 +0000 (09:55 +0100)]
test_run("spreadsheet","csvRead_regexp",["no_check_error_output" ]);

test_run("spreadsheet","bug_12140",["no_check_error_output" ]);

Change-Id: Id24cb385ae9f2b1b02f993ab5a2b114eb9752bef

scilab/modules/spreadsheet/src/c/csvRead.c

index 0d4d7c8..d37480a 100644 (file)
@@ -188,7 +188,11 @@ csvResult* csvRead(const char *filename, const char *separator, const char *deci
             pCleanedLines = removeComments((const char**)pstLines, nblines, (const char*)regexpcomments, &nbCleanedLines, &iErr);
             if (pCleanedLines)
             {
-                FREE(pwstLines);
+                if (pwstLines)
+                {
+                    freeArrayOfWideString(pwstLines, nblines);
+                    pwstLines = NULL;
+                }
                 FREE(pstLines);
                 pstLines = pCleanedLines;
                 nblines = nbCleanedLines;