[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJfpegt_pYg5ypOP+Epd5s=jg5K-g_drTPyOSAdy61d_-0PPiA@mail.gmail.com>
Date: Wed, 27 Jul 2022 15:29:07 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: williamsukatube@....com
Cc: overlayfs <linux-unionfs@...r.kernel.org>,
linux-kernel@...r.kernel.org,
William Dean <williamsukatube@...il.com>,
Hacash Robot <hacashRobot@...tino.com>
Subject: Re: [PATCH] ovl: Fix a potential memory leak for kstrdup()
On Wed, 13 Jul 2022 at 09:33, <williamsukatube@....com> wrote:
>
> From: William Dean <williamsukatube@...il.com>
>
> kfree() is missing on an error path to free the memory
> allocated by kstrdup():
>
> config->redirect_mode = kstrdup(ovl_redirect_mode_def(), GFP_KERNEL);
>
> So it is better to free it via kfree(config->redirect_mode).
Will be freed in ovl_free_fs().
Thanks,
Miklos
Powered by blists - more mailing lists