diff mbox series

[4/5] main: free cfgname before exiting

Message ID 20240705065434.3608030-5-dominique.martinet@atmark-techno.com
State Accepted
Headers show
Series misc fixes | expand

Commit Message

Dominique Martinet July 5, 2024, 6:54 a.m. UTC
This is not a problem but building with ASAN (CONFIG_EXTRA_CFLAGS and
LDFLAGS with -fsanitize=address) prints a warning that this value is not
freed every time; there is no harm in freeing it before exiting.

Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---
 core/swupdate.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stefano Babic July 5, 2024, 12:12 p.m. UTC | #1
On 05.07.24 08:54, Dominique Martinet wrote:
> This is not a problem but building with ASAN (CONFIG_EXTRA_CFLAGS and
> LDFLAGS with -fsanitize=address) prints a warning that this value is not
> freed every time; there is no harm in freeing it before exiting.
>
> Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
> ---
>   core/swupdate.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/core/swupdate.c b/core/swupdate.c
> index 8d6467b7b688..4f0ad963346e 100644
> --- a/core/swupdate.c
> +++ b/core/swupdate.c
> @@ -997,5 +997,6 @@ int main(int argc, char **argv)
>   	if (!opt_c && !opt_i)
>   		pthread_join(network_daemon, NULL);
>
> +	free(cfgfname);
>   	return exit_code;
>   }

Acked-by: Stefano Babic <stefano.babic@swupdate.org>

Best regards,
Stefano
diff mbox series

Patch

diff --git a/core/swupdate.c b/core/swupdate.c
index 8d6467b7b688..4f0ad963346e 100644
--- a/core/swupdate.c
+++ b/core/swupdate.c
@@ -997,5 +997,6 @@  int main(int argc, char **argv)
 	if (!opt_c && !opt_i)
 		pthread_join(network_daemon, NULL);
 
+	free(cfgfname);
 	return exit_code;
 }