fixed memory leak in fsm_opt

This commit is contained in:
Clifford Wolf 2014-07-22 22:52:57 +02:00
parent fd4cbe6275
commit e7e30f1c86
1 changed files with 3 additions and 1 deletions

View File

@ -44,9 +44,11 @@ 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);
return false;