From a06992d7d36ca35dfef8cd56c40974df31fcf4ad Mon Sep 17 00:00:00 2001 From: Guichard Desrosiers Date: Sun, 13 Dec 2020 23:40:06 -0500 Subject: [PATCH] Ensuring res is a valid pointer before attempting to free res->message --- src/check_hooks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/check_hooks.c b/src/check_hooks.c index 44a37f65..1fd3873e 100644 --- a/src/check_hooks.c +++ b/src/check_hooks.c @@ -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); }