Coverity #1357533 fixed 63/18463/2
Dhruv Khattar [Sun, 14 Aug 2016 11:02:15 +0000 (16:02 +0530)]
Change-Id: I44659216c4f5d53a7067b76f8f02f75f5dd3dbef

scilab/modules/fileio/sci_gateway/cpp/sci_mfprintf.cpp

index f461ab9..e71a7c1 100644 (file)
@@ -169,6 +169,11 @@ types::Function::ReturnValue sci_mfprintf(types::typed_list &in, int _iRetCount,
         if (iRet)
         {
             Scierror(999, _("%s: Error while writing in file: disk full or deleted file.\n"), "mprintf");
+            for (int i = 0; i < nbrOfLines; i++)
+            {
+                FREE(wcsStringToWrite[i]);
+            }
+            FREE(wcsStringToWrite);
             return types::Function::Error;
         }
     }