public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] show_archive_content: Fix trivial memory leak
@ 2021-05-11 17:17 Siddhesh Poyarekar
  2021-05-17 15:59 ` [PING][PATCH] " Siddhesh Poyarekar
  2021-05-17 17:04 ` [PATCH] " Adhemerval Zanella
  0 siblings, 2 replies; 3+ messages in thread
From: Siddhesh Poyarekar @ 2021-05-11 17:17 UTC (permalink / raw)
  To: libc-alpha

Fix trivial leak identified by coverity.  The program runs to exit and
the leak doesn't grow, but it's just cleaner to free the allocated
memory.
---
 locale/programs/locarchive.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index 6bb189ae37..f38e835c52 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -1742,6 +1742,7 @@ show_archive_content (const char *fname, int verbose)
 			: locnames[idx]);
 	      }
 	}
+      free (files);
     }
   else
     for (cnt = 0; cnt < used; ++cnt)
-- 
2.31.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PING][PATCH] show_archive_content: Fix trivial memory leak
  2021-05-11 17:17 [PATCH] show_archive_content: Fix trivial memory leak Siddhesh Poyarekar
@ 2021-05-17 15:59 ` Siddhesh Poyarekar
  2021-05-17 17:04 ` [PATCH] " Adhemerval Zanella
  1 sibling, 0 replies; 3+ messages in thread
From: Siddhesh Poyarekar @ 2021-05-17 15:59 UTC (permalink / raw)
  To: libc-alpha

Ping!  I'll push this in a couple of days if there are no objections 
since it is a pretty trivial fix.

Siddhesh

On 5/11/21 10:47 PM, Siddhesh Poyarekar via Libc-alpha wrote:
> Fix trivial leak identified by coverity.  The program runs to exit and
> the leak doesn't grow, but it's just cleaner to free the allocated
> memory.
> ---
>   locale/programs/locarchive.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
> index 6bb189ae37..f38e835c52 100644
> --- a/locale/programs/locarchive.c
> +++ b/locale/programs/locarchive.c
> @@ -1742,6 +1742,7 @@ show_archive_content (const char *fname, int verbose)
>   			: locnames[idx]);
>   	      }
>   	}
> +      free (files);
>       }
>     else
>       for (cnt = 0; cnt < used; ++cnt)
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] show_archive_content: Fix trivial memory leak
  2021-05-11 17:17 [PATCH] show_archive_content: Fix trivial memory leak Siddhesh Poyarekar
  2021-05-17 15:59 ` [PING][PATCH] " Siddhesh Poyarekar
@ 2021-05-17 17:04 ` Adhemerval Zanella
  1 sibling, 0 replies; 3+ messages in thread
From: Adhemerval Zanella @ 2021-05-17 17:04 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha



On 11/05/2021 14:17, Siddhesh Poyarekar via Libc-alpha wrote:
> Fix trivial leak identified by coverity.  The program runs to exit and
> the leak doesn't grow, but it's just cleaner to free the allocated
> memory.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  locale/programs/locarchive.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
> index 6bb189ae37..f38e835c52 100644
> --- a/locale/programs/locarchive.c
> +++ b/locale/programs/locarchive.c
> @@ -1742,6 +1742,7 @@ show_archive_content (const char *fname, int verbose)
>  			: locnames[idx]);
>  	      }
>  	}
> +      free (files);
>      }
>    else
>      for (cnt = 0; cnt < used; ++cnt)
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-17 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 17:17 [PATCH] show_archive_content: Fix trivial memory leak Siddhesh Poyarekar
2021-05-17 15:59 ` [PING][PATCH] " Siddhesh Poyarekar
2021-05-17 17:04 ` [PATCH] " Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).