diff mbox series

[1/1] archive_handler: fix archive_locale memory leak

Message ID 20211121195728.94858-1-james.hilliard1@gmail.com
State Accepted
Headers show
Series [1/1] archive_handler: fix archive_locale memory leak | expand

Commit Message

James Hilliard Nov. 21, 2021, 7:57 p.m. UTC
We need to free the archive_locale after use.

Fixes:
==628160== 240 bytes in 1 blocks are definitely lost in loss record 65 of 77
==628160==    at 0x483C855: malloc (vg_replace_malloc.c:380)
==628160==    by 0x5091119: newlocale (newlocale.c:200)
==628160==    by 0x133E48: extract (archive_handler.c:106)
==628160==    by 0x4868608: start_thread (pthread_create.c:477)
==628160==    by 0x517D292: clone (clone.S:95)
==628160==

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 handlers/archive_handler.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stefano Babic Nov. 22, 2021, 8:41 a.m. UTC | #1
On 21.11.21 20:57, James Hilliard wrote:
> We need to free the archive_locale after use.
> 
> Fixes:
> ==628160== 240 bytes in 1 blocks are definitely lost in loss record 65 of 77
> ==628160==    at 0x483C855: malloc (vg_replace_malloc.c:380)
> ==628160==    by 0x5091119: newlocale (newlocale.c:200)
> ==628160==    by 0x133E48: extract (archive_handler.c:106)
> ==628160==    by 0x4868608: start_thread (pthread_create.c:477)
> ==628160==    by 0x517D292: clone (clone.S:95)
> ==628160==
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>   handlers/archive_handler.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/handlers/archive_handler.c b/handlers/archive_handler.c
> index ced7554..ef8989f 100644
> --- a/handlers/archive_handler.c
> +++ b/handlers/archive_handler.c
> @@ -203,6 +203,7 @@ out:
>   
>   #ifdef CONFIG_LOCALE
>   	uselocale(old_locale);
> +	freelocale(archive_locale);
>   #endif
>   	data->exitval = exitval;
>   	pthread_exit(NULL);
> 

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/handlers/archive_handler.c b/handlers/archive_handler.c
index ced7554..ef8989f 100644
--- a/handlers/archive_handler.c
+++ b/handlers/archive_handler.c
@@ -203,6 +203,7 @@  out:
 
 #ifdef CONFIG_LOCALE
 	uselocale(old_locale);
+	freelocale(archive_locale);
 #endif
 	data->exitval = exitval;
 	pthread_exit(NULL);