]> git.ipfire.org Git - thirdparty/systemd.git/commit
udevadm: fix memleak
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Jul 2025 11:16:02 +0000 (20:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Jul 2025 13:07:41 +0000 (22:07 +0900)
commit4a58d8ed51a4b1f7e8febb52dc9f0b60cd916600
tree01448ff8be5d9ce53014436b97527ef0ab4227d0
parentfabcb1eb0615d79034d8515f65ac3b987440fc68
udevadm: fix memleak

Fixes a bug in a4a6e216739506153df88cbc8ac078cba4591e5f.

Fixes the following memleak:
```
$ sudo valgrind --leak-check=full build/udevadm cat /usr/lib/udev/rules.d
==3975939==
==3975939== HEAP SUMMARY:
==3975939==     in use at exit: 640 bytes in 1 blocks
==3975939==   total heap usage: 7,657 allocs, 7,656 frees, 964,328 bytes allocated
==3975939==
==3975939== 640 bytes in 1 blocks are definitely lost in loss record 1 of 1
==3975939==    at 0x4841866: malloc (vg_replace_malloc.c:446)
==3975939==    by 0x4ACA71F: malloc_multiply (alloc-util.h:92)
==3975939==    by 0x4ACF988: _hashmap_dump_entries_sorted (hashmap.c:2167)
==3975939==    by 0x4ACFC76: _hashmap_dump_sorted (hashmap.c:2209)
==3975939==    by 0x4AA60A4: hashmap_dump_sorted (hashmap.h:311)
==3975939==    by 0x4AA9077: dump_files (conf-files.c:397)
==3975939==    by 0x4AAA14E: conf_files_list_strv_full (conf-files.c:596)
==3975939==    by 0x42426A: search_rules_file (udevadm-util.c:301)
==3975939==    by 0x424768: search_rules_files (udevadm-util.c:334)
==3975939==    by 0x41287D: cat_main (udevadm-cat.c:110)
==3975939==    by 0x4A7B911: dispatch_verb (verbs.c:139)
==3975939==    by 0x427272: udevadm_main (udevadm.c:121)
==3975939==
==3975939== LEAK SUMMARY:
==3975939==    definitely lost: 640 bytes in 1 blocks
==3975939==    indirectly lost: 0 bytes in 0 blocks
==3975939==      possibly lost: 0 bytes in 0 blocks
==3975939==    still reachable: 0 bytes in 0 blocks
==3975939==         suppressed: 0 bytes in 0 blocks
==3975939==
==3975939== For lists of detected and suppressed errors, rerun with: -s
==3975939== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
```
src/udev/udevadm-util.c