dracutdevs / dracut

dracut the event driven initramfs infrastructure
https://github.com/dracutdevs/dracut/wiki
GNU General Public License v2.0
600 stars 399 forks source link

fix(dracut-install): release memory allocated for regular expressions #2573

Open aafeijoo-suse opened 10 months ago

aafeijoo-suse commented 10 months ago

Use regfree to free memory allocated by regcomp. Quoting [1]:

"If the preg argument to regexec() or regfree() is not a compiled regular expression returned by regcomp(), the result is undefined."

Therefore, regfree must only be called if regcomp succeeded.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/regcomp.html

Checklist

stale[bot] commented 6 months ago

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

stale[bot] commented 5 months ago

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.