+ fix flaws found with code analyzer tool

This commit is contained in:
wmayer
2014-05-07 13:09:44 +02:00
parent 94f10f5d95
commit 3b5cdda879
22 changed files with 111 additions and 119 deletions

View File

@@ -123,6 +123,8 @@ DocumentObjectExecReturn *FeatureTest::execute(void)
float f;
void *s;
// Code analyzers may complain about some errors. This can be ignored
// because this is done on purpose to test the error handling mechanism
switch(ExceptionType.getValue())
{
case 0: break;
@@ -131,7 +133,7 @@ DocumentObjectExecReturn *FeatureTest::execute(void)
case 3: *i=0;printf("%i",*i);break; // seg-vault
case 4: j=0; printf("%i",1/j); break; // int devision by zero
case 5: f=0.0; printf("%f",1/f); break; // float devision by zero
case 6: s = malloc(3600000000ul);break; // out-of-memory
case 6: s = malloc(3600000000ul); free(s); break; // out-of-memory
}
ExecCount.setValue(ExecCount.getValue() + 1);