Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The content of the kernel command line is assigned via `strdup`, but not freed on exit. This happens after each call to `getarg(s)`, what makes an interesting amount of bytes not released at every boot. ``` master> grep -r -o -e getarg -e getargs modules.d | wc -l 457 master> export CMDLINE=$(< /proc/cmdline) master> echo ${#CMDLINE} 130 afeijoo@localhost:~/src/dracut/opensuse-fork/master> valgrind --leak-check=full --show-leak-kinds=all ./dracut-getarg security ==24270== Memcheck, a memory error detector ==24270== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al. ==24270== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info ==24270== Command: ./dracut-getarg security ==24270== apparmor ==24270== ==24270== HEAP SUMMARY: ==24270== in use at exit: 131 bytes in 1 blocks ==24270== total heap usage: 2 allocs, 1 frees, 1,155 bytes allocated ==24270== ==24270== 131 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==24270== at 0x4838744: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==24270== by 0x490D839: strdup (in /lib64/libc-2.31.so) ==24270== by 0x108AF6: getarg (util.c:188) ==24270== by 0x108AF6: main (util.c:300) ==24270== ==24270== LEAK SUMMARY: ==24270== definitely lost: 131 bytes in 1 blocks ==24270== indirectly lost: 0 bytes in 0 blocks ==24270== possibly lost: 0 bytes in 0 blocks ==24270== still reachable: 0 bytes in 0 blocks ==24270== suppressed: 0 bytes in 0 blocks ==24270== ==24270== For lists of detected and suppressed errors, rerun with: -s ==24270== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) ```
- Loading branch information