Coverity #1321256, #1321259 fixed 74/18374/2
Dhruv Khattar [Sun, 17 Jul 2016 19:22:15 +0000 (00:22 +0530)]
Change-Id: Ic63eecf18467f93a27acef5d6936fccc0bef714f

scilab/modules/preferences/sci_gateway/cpp/sci_addModulePreferences.cpp
scilab/modules/preferences/sci_gateway/cpp/sci_removeModulePreferences.cpp

index 3e06d3a..7542c2b 100644 (file)
@@ -67,7 +67,10 @@ int sci_addModulePreferences(char * fname, void *pvApiCtx)
             return 0;
         }
 
-        getAllocatedSingleString(pvApiCtx, addr, array[i]);
+        if (getAllocatedSingleString(pvApiCtx, addr, array[i]))
+        {
+            return 0;
+        }
     }
 
     expTbxPath = expandPathVariable(const_cast<char *>(tbxPath));
index 805718e..218b90a 100644 (file)
@@ -51,7 +51,10 @@ int sci_removeModulePreferences(char * fname, void *pvApiCtx)
         {
             Scierror(999, gettext("%s: Wrong type for input argument #%i: string expected.\n"), fname, 1);
         }
-        getAllocatedSingleString(pvApiCtx, addr, &tbxName);
+        if (getAllocatedSingleString(pvApiCtx, addr, &tbxName))
+        {
+            return 0;
+        }
     }
 
     try