]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: release memory on builtin error path
authorTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 22 Feb 2025 18:53:43 +0000 (19:53 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 11 Mar 2025 18:46:33 +0000 (13:46 -0500)
commitfb176076e32111dc0c6155d9e66775f94c7ea13d
tree07db627769f2e3ad70917d1523b74f35e2f499b3
parentc4f9d944940550b0cb36e071bca995706c1bb6fa
libkmod: release memory on builtin error path

If the modules.builtin.modinfo file contains valid and invalid
lines, it is possible that libkmod leaks memory on error path.

Let strbuf API take care to always release strbuf and reset it
if allocated heap memory is taken away from it.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/291
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
(cherry picked from commit 51929659b2faad1288bea9502cb5a672ca15abff)
libkmod/libkmod-builtin.c