]> 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>
Fri, 7 Mar 2025 04:52:39 +0000 (22:52 -0600)
commit51929659b2faad1288bea9502cb5a672ca15abff
treeb89133c85b8e59dbb160e0968f560a3b600b4e03
parent45a0b46535603418f1ff90f696c70952bb52b3c3
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>
libkmod/libkmod-builtin.c