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)