Coverity #1368183, #1367380 Fixed issues 80/18880/3
sidgairo18 [Sat, 14 Jan 2017 11:02:46 +0000 (16:02 +0530)]
Change-Id: I2cdb8980ee5d45fa15d5ca6595c69f4eed22d1dc

scilab/modules/output_stream/sci_gateway/cpp/sci_diary.cpp

index d70bcc9..3b67c65 100644 (file)
@@ -1469,6 +1469,8 @@ static int AppendByFilenames(char *fname, void* pvApiCtx,
             {
                 printError(&sciErr, 0);
                 Scierror(999, _("%s: Memory allocation error.\n"), fname);
+                FREE(wfilenameUsed[0]);
+                delete[] wfilenameUsed;
                 return 0;
             }
 
@@ -1544,6 +1546,8 @@ static int NewByFilenames(char *fname, void* pvApiCtx,
             {
                 printError(&sciErr, 0);
                 Scierror(999, _("%s: Memory allocation error.\n"), fname);
+                FREE(wfilenameUsed[0]);
+                delete[] wfilenameUsed;
                 return 0;
             }