summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-22 22:52:57 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-22 22:52:57 +0200
commite7e30f1c86d978131a5f4c6e62b5b8d822696cd1 (patch)
tree6bbd4a19fffba864bd02a8b278d8029c888081f9
parentfd4cbe627527561fb08bc77467f2b6a250d5dc4d (diff)
fixed memory leak in fsm_opt
-rw-r--r--passes/fsm/fsm_opt.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/passes/fsm/fsm_opt.cc b/passes/fsm/fsm_opt.cc
index 367b38eb..d5a9b71f 100644
--- a/passes/fsm/fsm_opt.cc
+++ b/passes/fsm/fsm_opt.cc
@@ -44,8 +44,10 @@ struct FsmOpt
char *str = strdup(wire->attributes["\\unused_bits"].decode_string().c_str());
for (char *tok = strtok(str, " "); tok != NULL; tok = strtok(NULL, " ")) {
- if (tok[0] && bit == atoi(tok))
+ if (tok[0] && bit == atoi(tok)) {
+ free(str);
return true;
+ }
}
free(str);