Skip to content

Commit

Permalink
Ensuring res is a valid pointer before attempting to free res->message
Browse files Browse the repository at this point in the history
  • Loading branch information
gdesrosi committed Dec 14, 2020
1 parent df99b2e commit a06992d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/check_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ void display_check_issue_counts(const struct checks *ck)

void free_check_result(struct check_result *res)
{
free(res->message);
if (res) {
free(res->message);
}
free(res);
}

Expand Down

0 comments on commit a06992d

Please sign in to comment.