Skip to content

Commit

Permalink
Missing free.
Browse files Browse the repository at this point in the history
Spotted by ASAN.
  • Loading branch information
katef committed Jan 9, 2024
1 parent 78081b8 commit 32c8995
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libfsm/print/dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ print_dotfrag(FILE *f, const struct fsm *fsm)
const size_t count = fsm_getendidcount(fsm, i);
if (count > 0) {
ids = f_malloc(fsm->opt->alloc,
sizeof(*ids) + ((count - 1) * sizeof(ids->ids)));
sizeof(*ids) + ((count - 1) * sizeof(ids->ids)));
assert(ids != NULL);
if (ids == NULL) {
return -1;
Expand All @@ -203,6 +203,8 @@ print_dotfrag(FILE *f, const struct fsm *fsm)
}

fprintf(f, " ];\n");

f_free(fsm->opt->alloc, ids);
}

/* TODO: show example here, unless !opt->comments */
Expand Down

0 comments on commit 32c8995

Please sign in to comment.