Fix a few minor cppcheck warnings.

This patch fixes a minor memory leak and slight inefficiency
reported by cppcheck. It also updates the expected warning for
vpi/fstapi.c.
This commit is contained in:
Cary R 2011-04-18 11:12:38 -07:00 committed by Stephen Williams
parent 56b04891e0
commit 2158ebdf0b
3 changed files with 10 additions and 9 deletions

View File

@ -2245,6 +2245,7 @@ static unsigned is_utask_call_with_args(ivl_scope_t scope,
/* The pattern matched so this block represents a call to a user
* defined task with arguments. */
show_stmt_file_line(stmt, "User task call (with arguments).");
free(port_exprs);
return 1;
}

View File

@ -3,14 +3,14 @@
// problems will not be fixed.
// fstapi.c from GTKWave
variableScope:fstapi.c:1614
variableScope:fstapi.c:1731
variableScope:fstapi.c:1780
variableScope:fstapi.c:1781
variableScope:fstapi.c:2472
variableScope:fstapi.c:2787
variableScope:fstapi.c:2791
variableScope:fstapi.c:2792
variableScope:fstapi.c:1689
variableScope:fstapi.c:1817
variableScope:fstapi.c:1911
variableScope:fstapi.c:1912
variableScope:fstapi.c:2617
variableScope:fstapi.c:2937
variableScope:fstapi.c:2941
variableScope:fstapi.c:2942
// lxt2_write.c from GTKWave
variableScope:lxt2_write.c:63

View File

@ -2004,7 +2004,7 @@ bool of_DISABLE(vthread_t thr, vvp_code_t cp)
bool disabled_myself_flag = false;
while (scope->threads.size() > 0) {
while (! scope->threads.empty()) {
set<vthread_t>::iterator cur = scope->threads.begin();
/* If I am disabling myself, that remember that fact so