Coverity #1107272, #1356057 fixed 57/18457/2
Dhruv Khattar [Fri, 12 Aug 2016 20:14:41 +0000 (01:14 +0530)]
Change-Id: I7d9e812c23600c33db3e2c6e7fa5807caddad79b

scilab/modules/graphics/sci_gateway/c/sci_newaxes.c
scilab/modules/graphics/sci_gateway/c/sci_xclick.c

index 1d0e253..6f39541 100644 (file)
@@ -65,7 +65,6 @@ int sci_newaxes(char * fname, void *pvApiCtx)
         {
             if (createScalarHandle(pvApiCtx, iRhs + 1, getHandle(iSubwinUID)))
             {
-                printError(&sciErr, 0);
                 Scierror(999, _("%s: Memory allocation error.\n"), fname);
                 return 1;
             }
index e395e88..2c69034 100644 (file)
@@ -180,8 +180,8 @@ int sci_xclick(char *fname, void *pvApiCtx)
             deleteJxclickString(menuCallback);
             return 1;
         }
-        freeAllocatedSingleString(strRep);
         strncpy(strRep, menuCallback, istr);
+        freeAllocatedSingleString(strRep);
     }
 
     deleteJxclickString(menuCallback);