From: Tobias Stoeckmann Date: Thu, 18 May 2023 15:48:46 +0000 (+0200) Subject: lib/shells: Plug econf memory leak X-Git-Tag: v2.40-rc1~457^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b83e58a55ce4ac0f2e9b613f53eccde4bce09ff7;p=thirdparty%2Futil-linux.git lib/shells: Plug econf memory leak You can see the memory leak with address sanitizer if util-linux is compiled with `--with-vendordir=/usr/etc`. How to reproduce: 1. Prepare a custom shell file as root ``` mkdir -p /etc/shells.d echo /bin/myshell > /etc/shells.d/custom ``` 2. Run chsh as regular user ``` chsh ``` Signed-off-by: Tobias Stoeckmann --- diff --git a/lib/shells.c b/lib/shells.c index 6693ab0054..e0d065ee25 100644 --- a/lib/shells.c +++ b/lib/shells.c @@ -53,6 +53,7 @@ extern int is_known_shell(const char *shell_name) break; } } + econf_free (keys); econf_free (key_file); #else char *s;