From 8c80267352f171269a2d1c12c780db86ab27a023 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 14 May 2021 17:45:14 +0200 Subject: [PATCH] CLOG: Fix memleak in own recent improvement to CLOG filter. Mistake in rBef5782e29744. --- intern/clog/clog.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/intern/clog/clog.c b/intern/clog/clog.c index 50a51ebe913..416ea25ee0c 100644 --- a/intern/clog/clog.c +++ b/intern/clog/clog.c @@ -322,7 +322,9 @@ static bool clg_ctx_filter_check(CLogContext *ctx, const char *identifier) if (flt->match[0] == '*' && flt->match[len - 1] == '*') { char *match = MEM_callocN(sizeof(char) * len - 1, __func__); memcpy(match, flt->match + 1, len - 2); - if (strstr(identifier, match) != NULL) { + const bool success = (strstr(identifier, match) != NULL); + MEM_freeN(match); + if (success) { return (bool)i; } }