[systemd-devel] [PATCH 2/6] localectl: fix memleak, call set_free before return

Michal Schmidt mschmidt at redhat.com
Thu Oct 25 16:08:33 PDT 2012


Dne 25.10.2012 16:16, Michal Sekletar napsal(a):
> ---
>   src/locale/localectl.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/locale/localectl.c b/src/locale/localectl.c
> index c05eba0..16700fe 100644
> --- a/src/locale/localectl.c
> +++ b/src/locale/localectl.c
> @@ -354,6 +354,7 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) {
>               h->locrectab_offset + h->locrectab_size > st.st_size ||
>               h->sumhash_offset + h->sumhash_size > st.st_size) {
>                   log_error("Invalid archive file.");
> +                set_free(locales);
>                   return -EBADMSG;
>           }

Just use the single return point like the other error paths in this 
function.

Michal



More information about the systemd-devel mailing list