[Bf-blender-cvs] [8c80267352f] master: CLOG: Fix memleak in own recent improvement to CLOG filter.

Bastien Montagne noreply at git.blender.org
Fri May 14 17:51:10 CEST 2021


Commit: 8c80267352f171269a2d1c12c780db86ab27a023
Author: Bastien Montagne
Date:   Fri May 14 17:45:14 2021 +0200
Branches: master
https://developer.blender.org/rB8c80267352f171269a2d1c12c780db86ab27a023

CLOG: Fix memleak in own recent improvement to CLOG filter.

Mistake in rBef5782e29744.

===================================================================

M	intern/clog/clog.c

===================================================================

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;
         }
       }



More information about the Bf-blender-cvs mailing list