Coverity: fileio module memory errors fixed.
[scilab.git] / scilab / modules / fileio / sci_gateway / cpp / sci_mscanf.cpp
index 3af586f..d719ddc 100644 (file)
@@ -124,23 +124,15 @@ types::Function::ReturnValue sci_mscanf(types::typed_list &in, int _iRetCount, t
             switch (err)
             {
                 case DO_XXPRINTF_MISMATCH:
-                    if (iNiter >= 0)
-                    {
-                        Free_Scan(rowcount, ncol, type_s, &data);
-                        Scierror(999, _("%s: Data mismatch.\n"), "mscanf");
-                        return types::Function::Error;
-                    }
-                    break;
+                    Free_Scan(rowcount, ncol, type_s, &data);
+                    Scierror(999, _("%s: Data mismatch.\n"), "mscanf");
+                    return types::Function::Error;
 
                 case DO_XXPRINTF_MEM_LACK:
                     Free_Scan(rowcount, ncol, type_s, &data);
                     Scierror(999, _("%s: No more memory.\n"), "mscanf");
                     return types::Function::Error;
             }
-            if (err == DO_XXPRINTF_MISMATCH)
-            {
-                break;
-            }
         }
     }