diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-07-22 22:52:57 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-07-22 22:52:57 +0200 |
commit | e7e30f1c86d978131a5f4c6e62b5b8d822696cd1 (patch) | |
tree | 6bbd4a19fffba864bd02a8b278d8029c888081f9 /passes | |
parent | fd4cbe627527561fb08bc77467f2b6a250d5dc4d (diff) | |
download | yosys-e7e30f1c86d978131a5f4c6e62b5b8d822696cd1.tar.gz yosys-e7e30f1c86d978131a5f4c6e62b5b8d822696cd1.tar.bz2 yosys-e7e30f1c86d978131a5f4c6e62b5b8d822696cd1.zip |
fixed memory leak in fsm_opt
Diffstat (limited to 'passes')
-rw-r--r-- | passes/fsm/fsm_opt.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/passes/fsm/fsm_opt.cc b/passes/fsm/fsm_opt.cc index 367b38eb1..d5a9b71fa 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); |