Florian Westphal d2a427c4ab monitor: fix memleak in setelem cb
since 4521732ebbf3 ("monitor: missing cache and set handle initialization")
these fields are set via handle_merge(), so don't clobber those
fields in json output case:

==31877==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 16 byte(s) in 2 object(s) allocated from:
 #0 0x7f0cb9f29d4b in strdup asan/asan_interceptors.cpp:593
 #1 0x7f0cb9b584fd in xstrdup src/utils.c:80
 #2 0x7f0cb9b355b3 in handle_merge src/rule.c:127
 #3 0x7f0cb9ae12b8 in netlink_events_setelem_cb src/monitor.c:457

Seen when running tests/monitor with asan enabled.

Fixes: 4521732ebbf3 ("monitor: missing cache and set handle initialization")
Signed-off-by: Florian Westphal <fw@strlen.de>
2026-01-22 12:00:27 +01:00
2026-01-20 16:03:12 +01:00
2026-01-22 12:00:27 +01:00
2009-03-18 04:55:00 +01:00
2018-03-21 14:23:51 +01:00
2025-12-03 23:13:08 +01:00
Description
No description provided
7.3 MiB
Languages
C 61.3%
Shell 21.7%
Yacc 6%
Raku 3.5%
Python 2.9%
Other 4.6%