mirror of https://github.com/YosysHQ/yosys.git
fixed memory leak in fsm_opt
This commit is contained in:
parent
fd4cbe6275
commit
e7e30f1c86
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue