Describe the bug

Memory leak is reported by the memory sanitizer during a tests which tries to use MODULE LOADEX passing a numeric config parameter which is out of the valid range.

To reproduce The error was detected during the implementation of CONFIG parameters for RediSearch module. The full log of the github flow is here

Expected behavior No memory leak detected.

Additional information

Sanitizer log file
==27126==Registered root region at 0x7f10c86007a0 of size 32
==27126==Registered root region at 0x7f10c8200f40 of size 64
==27126==Unregistered root region at 0x7f10c8200f40 of size 64
==27126==AddressSanitizer: failed to intercept '__isoc99_printf'
==27126==Registered root region at 0x7f10c8200f40 of size 64
==27126==Unregistered root region at 0x7f10c8200f40 of size 64
==27126==AddressSanitizer: failed to intercept '__isoc99_sprintf'
==27126==Registered root region at 0x7f10c8200f40 of size 64
==27126==Unregistered root region at 0x7f10c8200f40 of size 64
==27126==AddressSanitizer: failed to intercept '__isoc99_snprintf'
==27126==Registered root region at 0x7f10c8200f40 of size 64
==27126==Unregistered root region at 0x7f10c8200f40 of size 64
==27126==AddressSanitizer: failed to intercept '__isoc99_fprintf'
==27126==Registered root region at 0x7f10c8200f40 of size 64
==27126==Unregistered root region at 0x7f10c8200f40 of size 64
==27126==AddressSanitizer: failed to intercept '__isoc99_vprintf'
==27126==Registered root region at 0x7f10c8200f40 of size 64
==27126==Unregistered root region at 0x7f10c8200f40 of size 64
==27126==AddressSanitizer: failed to intercept '__isoc99_vsprintf'
==27126==Registered root region at 0x7f10c8200f40 of size 64
==27126==Unregistered root region at 0x7f10c8200f40 of size 64
==27126==AddressSanitizer: failed to intercept '__isoc99_vsnprintf'
==27126==Registered root region at 0x7f10c8200f40 of size 64
==27126==Unregistered root region at 0x7f10c8200f40 of size 64
==27126==AddressSanitizer: failed to intercept '__isoc99_vfprintf'
==27126==Registered root region at 0x7f10c8200f40 of size 64
==27126==Unregistered root region at 0x7f10c8200f40 of size 64
==27126==AddressSanitizer: failed to intercept 'xdr_destroy'
==27126==Registered root region at 0x7f10c8000b70 of size 48
==27126==Unregistered root region at 0x7f10c8000b70 of size 48
==27126==AddressSanitizer: failed to intercept 'crypt'
==27126==Registered root region at 0x7f10c8000b70 of size 48
==27126==Unregistered root region at 0x7f10c8000b70 of size 48
==27126==AddressSanitizer: failed to intercept 'crypt_r'
==27126==Registered root region at 0x7f10c7e01310 of size 80
==27126==Unregistered root region at 0x7f10c7e01310 of size 80
==27126==AddressSanitizer: failed to intercept '__cxa_rethrow_primary_exception'
==27126==AddressSanitizer: libc interceptors initialized
|| `[0x10007fff8000, 0x7fffffffffff]` || HighMem    ||
|| `[0x02008fff7000, 0x10007fff7fff]` || HighShadow ||
|| `[0x00008fff7000, 0x02008fff6fff]` || ShadowGap  ||
|| `[0x00007fff8000, 0x00008fff6fff]` || LowShadow  ||
|| `[0x000000000000, 0x00007fff7fff]` || LowMem     ||
MemToShadow(shadow): 0x00008fff7000 0x000091ff6dff 0x004091ff6e00 0x02008fff6fff
redzone=16
max_redzone=2048
quarantine_size_mb=256M
thread_local_quarantine_size_kb=1024K
malloc_context_size=30
SHADOW_SCALE: 3
SHADOW_GRANULARITY: 8
SHADOW_OFFSET: 0x7fff8000
==27126==Installed the sigaction for signal 11
==27126==Installed the sigaction for signal 7
==27126==Installed the sigaction for signal 8
==27126==T0: FakeStack created: 0x7f10c62f7000 -- 0x7f10c6e00000 stack_size_log: 20; mmapped 11300K, noreserve=0 
==27126==T0: stack [0x7ffdfb1d0000,0x7ffdfc1d0000) size 0x1000000; local=0x7ffdfc1cd954
==27126==AddressSanitizer Init done
==27126==T1: FakeStack created: 0x7f10c22f4000 -- 0x7f10c2dfd000 stack_size_log: 20; mmapped 11300K, noreserve=0 
==27126==T1: stack [0x7f10c4e00000,0x7f10c5dfef40) size 0xffef40; local=0x7f10c5dfee44
==27126==T3: FakeStack created: 0x7f10c17eb000 -- 0x7f10c22f4000 stack_size_log: 20; mmapped 11300K, noreserve=0 
==27126==T3: stack [0x7f10c2dfe000,0x7f10c3dfcf40) size 0xffef40; local=0x7f10c3dfce44
==27126==T2: FakeStack created: 0x7f10c0ce2000 -- 0x7f10c17eb000 stack_size_log: 20; mmapped 11300K, noreserve=0 
==27126==T2: stack [0x7f10c3dff000,0x7f10c4dfdf40) size 0xffef40; local=0x7f10c4dfde44
==27126==LeakSanitizer: checking for leaksAddressSanitizer: reading suppressions file at /__w/RediSearch/RediSearch/tests/memcheck/asan.supp

=================================================================
==27126==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 120 byte(s) in 1 object(s) allocated from:
    #0 0x561bf1d1762e in malloc (/usr/local/bin/redis-server-asan-8.0+0x31e62e) (BuildId: 142bfd57912f4bd11793e6553d20097a64c9d0bf)
    #1 0x561bf1dae639 in ztrymalloc_usable_internal /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:121:17
    #2 0x561bf1dae639 in zmalloc /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:150:17
    #3 0x561bf1fa1427 in RM_GetDetachedThreadSafeContext /tmp/redis.k8l6g0xw/redis/src/module.c:8568:31
    #4 0x7f10bfbd1f7b  (<unknown module>)
    #5 0x561bf1fb8a15 in moduleLoad /tmp/redis.k8l6g0xw/redis/src/module.c:12330:9
    #6 0x561bf1fbee73 in moduleCommand /tmp/redis.k8l6g0xw/redis/src/module.c:13177:13
    #7 0x561bf1d8c0d2 in call /tmp/redis.k8l6g0xw/redis/src/server.c:3594:5
    #8 0x561bf1d8f0ad in processCommand /tmp/redis.k8l6g0xw/redis/src/server.c:4225:9
    #9 0x561bf1ddf057 in processCommandAndResetClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2568:9
    #10 0x561bf1ddf057 in processInputBuffer /tmp/redis.k8l6g0xw/redis/src/networking.c:2676:17
    #11 0x561bf1dc5902 in readQueryFromClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2847:9
    #12 0x561bf20252e0 in callHandler /tmp/redis.k8l6g0xw/redis/src/./connhelpers.h:58:18
    #13 0x561bf20252e0 in connSocketEventHandler /tmp/redis.k8l6g0xw/redis/src/socket.c:277:14
    #14 0x561bf1d5fd90 in aeProcessEvents /tmp/redis.k8l6g0xw/redis/src/ae.c:417:17
    #15 0x561bf1d60a0c in aeMain /tmp/redis.k8l6g0xw/redis/src/ae.c:477:9
    #16 0x561bf1d9d7e0 in main /tmp/redis.k8l6g0xw/redis/src/server.c:7275:5
    #17 0x7f10c8af6d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09) (BuildId: b503275bf9fee51581fdceef97533b194035b4f7)

Indirect leak of 16384 byte(s) in 1 object(s) allocated from:
    #0 0x561bf1d1762e in malloc (/usr/local/bin/redis-server-asan-8.0+0x31e62e) (BuildId: 142bfd57912f4bd11793e6553d20097a64c9d0bf)
    #1 0x561bf1dae81d in ztrymalloc_usable_internal /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:121:17
    #2 0x561bf1dae81d in zmalloc_usable /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:165:17
    #3 0x561bf1dc39d2 in createClient /tmp/redis.k8l6g0xw/redis/src/networking.c:130:14
    #4 0x561bf1fa14ba in moduleCreateContext /tmp/redis.k8l6g0xw/redis/src/module.c:882:27
    #5 0x561bf1fa14ba in RM_GetDetachedThreadSafeContext /tmp/redis.k8l6g0xw/redis/src/module.c:8571:5
    #6 0x7f10bfbd1f7b  (<unknown module>)
    #7 0x561bf1fb8a15 in moduleLoad /tmp/redis.k8l6g0xw/redis/src/module.c:12330:9
    #8 0x561bf1fbee73 in moduleCommand /tmp/redis.k8l6g0xw/redis/src/module.c:13177:13
    #9 0x561bf1d8c0d2 in call /tmp/redis.k8l6g0xw/redis/src/server.c:3594:5
    #10 0x561bf1d8f0ad in processCommand /tmp/redis.k8l6g0xw/redis/src/server.c:4225:9
    #11 0x561bf1ddf057 in processCommandAndResetClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2568:9
    #12 0x561bf1ddf057 in processInputBuffer /tmp/redis.k8l6g0xw/redis/src/networking.c:2676:17
    #13 0x561bf1dc5902 in readQueryFromClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2847:9
    #14 0x561bf20252e0 in callHandler /tmp/redis.k8l6g0xw/redis/src/./connhelpers.h:58:18
    #15 0x561bf20252e0 in connSocketEventHandler /tmp/redis.k8l6g0xw/redis/src/socket.c:277:14
    #16 0x561bf1d5fd90 in aeProcessEvents /tmp/redis.k8l6g0xw/redis/src/ae.c:417:17
    #17 0x561bf1d60a0c in aeMain /tmp/redis.k8l6g0xw/redis/src/ae.c:477:9
    #18 0x561bf1d9d7e0 in main /tmp/redis.k8l6g0xw/redis/src/server.c:7275:5
    #19 0x7f10c8af6d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09) (BuildId: b503275bf9fee51581fdceef97533b194035b4f7)

Indirect leak of 784 byte(s) in 1 object(s) allocated from:
    #0 0x561bf1d1762e in malloc (/usr/local/bin/redis-server-asan-8.0+0x31e62e) (BuildId: 142bfd57912f4bd11793e6553d20097a64c9d0bf)
    #1 0x561bf1dae639 in ztrymalloc_usable_internal /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:121:17
    #2 0x561bf1dae639 in zmalloc /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:150:17
    #3 0x561bf1dc3915 in createClient /tmp/redis.k8l6g0xw/redis/src/networking.c:117:17
    #4 0x561bf1fa14ba in moduleCreateContext /tmp/redis.k8l6g0xw/redis/src/module.c:882:27
    #5 0x561bf1fa14ba in RM_GetDetachedThreadSafeContext /tmp/redis.k8l6g0xw/redis/src/module.c:8571:5
    #6 0x7f10bfbd1f7b  (<unknown module>)
    #7 0x561bf1fb8a15 in moduleLoad /tmp/redis.k8l6g0xw/redis/src/module.c:12330:9
    #8 0x561bf1fbee73 in moduleCommand /tmp/redis.k8l6g0xw/redis/src/module.c:13177:13
    #9 0x561bf1d8c0d2 in call /tmp/redis.k8l6g0xw/redis/src/server.c:3594:5
    #10 0x561bf1d8f0ad in processCommand /tmp/redis.k8l6g0xw/redis/src/server.c:4225:9
    #11 0x561bf1ddf057 in processCommandAndResetClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2568:9
    #12 0x561bf1ddf057 in processInputBuffer /tmp/redis.k8l6g0xw/redis/src/networking.c:2676:17
    #13 0x561bf1dc5902 in readQueryFromClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2847:9
    #14 0x561bf20252e0 in callHandler /tmp/redis.k8l6g0xw/redis/src/./connhelpers.h:58:18
    #15 0x561bf20252e0 in connSocketEventHandler /tmp/redis.k8l6g0xw/redis/src/socket.c:277:14
    #16 0x561bf1d5fd90 in aeProcessEvents /tmp/redis.k8l6g0xw/redis/src/ae.c:417:17
    #17 0x561bf1d60a0c in aeMain /tmp/redis.k8l6g0xw/redis/src/ae.c:477:9
    #18 0x561bf1d9d7e0 in main /tmp/redis.k8l6g0xw/redis/src/server.c:7275:5
    #19 0x7f10c8af6d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09) (BuildId: b503275bf9fee51581fdceef97533b194035b4f7)

Indirect leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x561bf1d1762e in malloc (/usr/local/bin/redis-server-asan-8.0+0x31e62e) (BuildId: 142bfd57912f4bd11793e6553d20097a64c9d0bf)
    #1 0x561bf1dae639 in ztrymalloc_usable_internal /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:121:17
    #2 0x561bf1dae639 in zmalloc /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:150:17
    #3 0x561bf1d645f2 in dictCreate /tmp/redis.k8l6g0xw/redis/src/dict.c:187:15
    #4 0x561bf1f5fec1 in initClientBlockingState /tmp/redis.k8l6g0xw/redis/src/blocked.c:57:22
    #5 0x561bf1dc3eb6 in createClient /tmp/redis.k8l6g0xw/redis/src/networking.c:189:5
    #6 0x561bf1fa14ba in moduleCreateContext /tmp/redis.k8l6g0xw/redis/src/module.c:882:27
    #7 0x561bf1fa14ba in RM_GetDetachedThreadSafeContext /tmp/redis.k8l6g0xw/redis/src/module.c:8571:5
    #8 0x7f10bfbd1f7b  (<unknown module>)
    #9 0x561bf1fb8a15 in moduleLoad /tmp/redis.k8l6g0xw/redis/src/module.c:12330:9
    #10 0x561bf1fbee73 in moduleCommand /tmp/redis.k8l6g0xw/redis/src/module.c:13177:13
    #11 0x561bf1d8c0d2 in call /tmp/redis.k8l6g0xw/redis/src/server.c:3594:5
    #12 0x561bf1d8f0ad in processCommand /tmp/redis.k8l6g0xw/redis/src/server.c:4225:9
    #13 0x561bf1ddf057 in processCommandAndResetClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2568:9
    #14 0x561bf1ddf057 in processInputBuffer /tmp/redis.k8l6g0xw/redis/src/networking.c:2676:17
    #15 0x561bf1dc5902 in readQueryFromClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2847:9
    #16 0x561bf20252e0 in callHandler /tmp/redis.k8l6g0xw/redis/src/./connhelpers.h:58:18
    #17 0x561bf20252e0 in connSocketEventHandler /tmp/redis.k8l6g0xw/redis/src/socket.c:277:14
    #18 0x561bf1d5fd90 in aeProcessEvents /tmp/redis.k8l6g0xw/redis/src/ae.c:417:17
    #19 0x561bf1d60a0c in aeMain /tmp/redis.k8l6g0xw/redis/src/ae.c:477:9
    #20 0x561bf1d9d7e0 in main /tmp/redis.k8l6g0xw/redis/src/server.c:7275:5
    #21 0x7f10c8af6d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09) (BuildId: b503275bf9fee51581fdceef97533b194035b4f7)

Indirect leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x561bf1d1762e in malloc (/usr/local/bin/redis-server-asan-8.0+0x31e62e) (BuildId: 142bfd57912f4bd11793e6553d20097a64c9d0bf)
    #1 0x561bf1dae639 in ztrymalloc_usable_internal /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:121:17
    #2 0x561bf1dae639 in zmalloc /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:150:17
    #3 0x561bf1d645f2 in dictCreate /tmp/redis.k8l6g0xw/redis/src/dict.c:187:15
    #4 0x561bf1dc3f6f in createClient /tmp/redis.k8l6g0xw/redis/src/networking.c:194:31
    #5 0x561bf1fa14ba in moduleCreateContext /tmp/redis.k8l6g0xw/redis/src/module.c:882:27
    #6 0x561bf1fa14ba in RM_GetDetachedThreadSafeContext /tmp/redis.k8l6g0xw/redis/src/module.c:8571:5
    #7 0x7f10bfbd1f7b  (<unknown module>)
    #8 0x561bf1fb8a15 in moduleLoad /tmp/redis.k8l6g0xw/redis/src/module.c:12330:9
    #9 0x561bf1fbee73 in moduleCommand /tmp/redis.k8l6g0xw/redis/src/module.c:13177:13
    #10 0x561bf1d8c0d2 in call /tmp/redis.k8l6g0xw/redis/src/server.c:3594:5
    #11 0x561bf1d8f0ad in processCommand /tmp/redis.k8l6g0xw/redis/src/server.c:4225:9
    #12 0x561bf1ddf057 in processCommandAndResetClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2568:9
    #13 0x561bf1ddf057 in processInputBuffer /tmp/redis.k8l6g0xw/redis/src/networking.c:2676:17
    #14 0x561bf1dc5902 in readQueryFromClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2847:9
    #15 0x561bf20252e0 in callHandler /tmp/redis.k8l6g0xw/redis/src/./connhelpers.h:58:18
    #16 0x561bf20252e0 in connSocketEventHandler /tmp/redis.k8l6g0xw/redis/src/socket.c:277:14
    #17 0x561bf1d5fd90 in aeProcessEvents /tmp/redis.k8l6g0xw/redis/src/ae.c:417:17
    #18 0x561bf1d60a0c in aeMain /tmp/redis.k8l6g0xw/redis/src/ae.c:477:9
    #19 0x561bf1d9d7e0 in main /tmp/redis.k8l6g0xw/redis/src/server.c:7275:5
    #20 0x7f10c8af6d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09) (BuildId: b503275bf9fee51581fdceef97533b194035b4f7)

Indirect leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x561bf1d1762e in malloc (/usr/local/bin/redis-server-asan-8.0+0x31e62e) (BuildId: 142bfd57912f4bd11793e6553d20097a64c9d0bf)
    #1 0x561bf1dae639 in ztrymalloc_usable_internal /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:121:17
    #2 0x561bf1dae639 in zmalloc /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:150:17
    #3 0x561bf1d645f2 in dictCreate /tmp/redis.k8l6g0xw/redis/src/dict.c:187:15
    #4 0x561bf1dc3f41 in createClient /tmp/redis.k8l6g0xw/redis/src/networking.c:193:26
    #5 0x561bf1fa14ba in moduleCreateContext /tmp/redis.k8l6g0xw/redis/src/module.c:882:27
    #6 0x561bf1fa14ba in RM_GetDetachedThreadSafeContext /tmp/redis.k8l6g0xw/redis/src/module.c:8571:5
    #7 0x7f10bfbd1f7b  (<unknown module>)
    #8 0x561bf1fb8a15 in moduleLoad /tmp/redis.k8l6g0xw/redis/src/module.c:12330:9
    #9 0x561bf1fbee73 in moduleCommand /tmp/redis.k8l6g0xw/redis/src/module.c:13177:13
    #10 0x561bf1d8c0d2 in call /tmp/redis.k8l6g0xw/redis/src/server.c:3594:5
    #11 0x561bf1d8f0ad in processCommand /tmp/redis.k8l6g0xw/redis/src/server.c:4225:9
    #12 0x561bf1ddf057 in processCommandAndResetClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2568:9
    #13 0x561bf1ddf057 in processInputBuffer /tmp/redis.k8l6g0xw/redis/src/networking.c:2676:17
    #14 0x561bf1dc5902 in readQueryFromClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2847:9
    #15 0x561bf20252e0 in callHandler /tmp/redis.k8l6g0xw/redis/src/./connhelpers.h:58:18
    #16 0x561bf20252e0 in connSocketEventHandler /tmp/redis.k8l6g0xw/redis/src/socket.c:277:14
    #17 0x561bf1d5fd90 in aeProcessEvents /tmp/redis.k8l6g0xw/redis/src/ae.c:417:17
    #18 0x561bf1d60a0c in aeMain /tmp/redis.k8l6g0xw/redis/src/ae.c:477:9
    #19 0x561bf1d9d7e0 in main /tmp/redis.k8l6g0xw/redis/src/server.c:7275:5
    #20 0x7f10c8af6d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09) (BuildId: b503275bf9fee51581fdceef97533b194035b4f7)

Indirect leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x561bf1d1762e in malloc (/usr/local/bin/redis-server-asan-8.0+0x31e62e) (BuildId: 142bfd57912f4bd11793e6553d20097a64c9d0bf)
    #1 0x561bf1dae639 in ztrymalloc_usable_internal /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:121:17
    #2 0x561bf1dae639 in zmalloc /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:150:17
    #3 0x561bf1d645f2 in dictCreate /tmp/redis.k8l6g0xw/redis/src/dict.c:187:15
    #4 0x561bf1dc3f13 in createClient /tmp/redis.k8l6g0xw/redis/src/networking.c:192:26
    #5 0x561bf1fa14ba in moduleCreateContext /tmp/redis.k8l6g0xw/redis/src/module.c:882:27
    #6 0x561bf1fa14ba in RM_GetDetachedThreadSafeContext /tmp/redis.k8l6g0xw/redis/src/module.c:8571:5
    #7 0x7f10bfbd1f7b  (<unknown module>)
    #8 0x561bf1fb8a15 in moduleLoad /tmp/redis.k8l6g0xw/redis/src/module.c:12330:9
    #9 0x561bf1fbee73 in moduleCommand /tmp/redis.k8l6g0xw/redis/src/module.c:13177:13
    #10 0x561bf1d8c0d2 in call /tmp/redis.k8l6g0xw/redis/src/server.c:3594:5
    #11 0x561bf1d8f0ad in processCommand /tmp/redis.k8l6g0xw/redis/src/server.c:4225:9
    #12 0x561bf1ddf057 in processCommandAndResetClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2568:9
    #13 0x561bf1ddf057 in processInputBuffer /tmp/redis.k8l6g0xw/redis/src/networking.c:2676:17
    #14 0x561bf1dc5902 in readQueryFromClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2847:9
    #15 0x561bf20252e0 in callHandler /tmp/redis.k8l6g0xw/redis/src/./connhelpers.h:58:18
    #16 0x561bf20252e0 in connSocketEventHandler /tmp/redis.k8l6g0xw/redis/src/socket.c:277:14
    #17 0x561bf1d5fd90 in aeProcessEvents /tmp/redis.k8l6g0xw/redis/src/ae.c:417:17
    #18 0x561bf1d60a0c in aeMain /tmp/redis.k8l6g0xw/redis/src/ae.c:477:9
    #19 0x561bf1d9d7e0 in main /tmp/redis.k8l6g0xw/redis/src/server.c:7275:5
    #20 0x7f10c8af6d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09) (BuildId: b503275bf9fee51581fdceef97533b194035b4f7)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x561bf1d1762e in malloc (/usr/local/bin/redis-server-asan-8.0+0x31e62e) (BuildId: 142bfd57912f4bd11793e6553d20097a64c9d0bf)
    #1 0x561bf1dae639 in ztrymalloc_usable_internal /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:121:17
    #2 0x561bf1dae639 in zmalloc /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:150:17
    #3 0x561bf1d5219f in listCreate /tmp/redis.k8l6g0xw/redis/src/adlist.c:25:17
    #4 0x561bf1dc3ee1 in createClient /tmp/redis.k8l6g0xw/redis/src/networking.c:191:23
    #5 0x561bf1fa14ba in moduleCreateContext /tmp/redis.k8l6g0xw/redis/src/module.c:882:27
    #6 0x561bf1fa14ba in RM_GetDetachedThreadSafeContext /tmp/redis.k8l6g0xw/redis/src/module.c:8571:5
    #7 0x7f10bfbd1f7b  (<unknown module>)
    #8 0x561bf1fb8a15 in moduleLoad /tmp/redis.k8l6g0xw/redis/src/module.c:12330:9
    #9 0x561bf1fbee73 in moduleCommand /tmp/redis.k8l6g0xw/redis/src/module.c:13177:13
    #10 0x561bf1d8c0d2 in call /tmp/redis.k8l6g0xw/redis/src/server.c:3594:5
    #11 0x561bf1d8f0ad in processCommand /tmp/redis.k8l6g0xw/redis/src/server.c:4225:9
    #12 0x561bf1ddf057 in processCommandAndResetClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2568:9
    #13 0x561bf1ddf057 in processInputBuffer /tmp/redis.k8l6g0xw/redis/src/networking.c:2676:17
    #14 0x561bf1dc5902 in readQueryFromClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2847:9
    #15 0x561bf20252e0 in callHandler /tmp/redis.k8l6g0xw/redis/src/./connhelpers.h:58:18
    #16 0x561bf20252e0 in connSocketEventHandler /tmp/redis.k8l6g0xw/redis/src/socket.c:277:14
    #17 0x561bf1d5fd90 in aeProcessEvents /tmp/redis.k8l6g0xw/redis/src/ae.c:417:17
    #18 0x561bf1d60a0c in aeMain /tmp/redis.k8l6g0xw/redis/src/ae.c:477:9
    #19 0x561bf1d9d7e0 in main /tmp/redis.k8l6g0xw/redis/src/server.c:7275:5
    #20 0x7f10c8af6d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09) (BuildId: b503275bf9fee51581fdceef97533b194035b4f7)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x561bf1d1762e in malloc (/usr/local/bin/redis-server-asan-8.0+0x31e62e) (BuildId: 142bfd57912f4bd11793e6553d20097a64c9d0bf)
    #1 0x561bf1dae639 in ztrymalloc_usable_internal /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:121:17
    #2 0x561bf1dae639 in zmalloc /tmp/redis.k8l6g0xw/redis/src/zmalloc.c:150:17
    #3 0x561bf1d5219f in listCreate /tmp/redis.k8l6g0xw/redis/src/adlist.c:25:17
    #4 0x561bf1dc3e0b in createClient /tmp/redis.k8l6g0xw/redis/src/networking.c:183:16
    #5 0x561bf1fa14ba in moduleCreateContext /tmp/redis.k8l6g0xw/redis/src/module.c:882:27
    #6 0x561bf1fa14ba in RM_GetDetachedThreadSafeContext /tmp/redis.k8l6g0xw/redis/src/module.c:8571:5
    #7 0x7f10bfbd1f7b  (<unknown module>)
    #8 0x561bf1fb8a15 in moduleLoad /tmp/redis.k8l6g0xw/redis/src/module.c:12330:9
    #9 0x561bf1fbee73 in moduleCommand /tmp/redis.k8l6g0xw/redis/src/module.c:13177:13
    #10 0x561bf1d8c0d2 in call /tmp/redis.k8l6g0xw/redis/src/server.c:3594:5
    #11 0x561bf1d8f0ad in processCommand /tmp/redis.k8l6g0xw/redis/src/server.c:4225:9
    #12 0x561bf1ddf057 in processCommandAndResetClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2568:9
    #13 0x561bf1ddf057 in processInputBuffer /tmp/redis.k8l6g0xw/redis/src/networking.c:2676:17
    #14 0x561bf1dc5902 in readQueryFromClient /tmp/redis.k8l6g0xw/redis/src/networking.c:2847:9
    #15 0x561bf20252e0 in callHandler /tmp/redis.k8l6g0xw/redis/src/./connhelpers.h:58:18
    #16 0x561bf20252e0 in connSocketEventHandler /tmp/redis.k8l6g0xw/redis/src/socket.c:277:14
    #17 0x561bf1d5fd90 in aeProcessEvents /tmp/redis.k8l6g0xw/redis/src/ae.c:417:17
    #18 0x561bf1d60a0c in aeMain /tmp/redis.k8l6g0xw/redis/src/ae.c:477:9
    #19 0x561bf1d9d7e0 in main /tmp/redis.k8l6g0xw/redis/src/server.c:7275:5
    #20 0x7f10c8af6d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09) (BuildId: b503275bf9fee51581fdceef97533b194035b4f7)

SUMMARY: AddressSanitizer: 17608 byte(s) leaked in 9 allocation(s).

Thank you.

Comment From: sundb

@nafraf thanks, but i'm wondering if these leaks from module?

Comment From: nafraf

@sundb I found that the module (master branch) does not have the implementation of RedisModule_OnUnload(...), and it's causing the memory leak during the test, so I'm closing this issue. Thanks.