diff mbox series

progress client: fix memory leak

Message ID 20170926145806.18236-1-christian.storm@siemens.com
State Accepted
Headers show
Series progress client: fix memory leak | expand

Commit Message

Storm, Christian Sept. 26, 2017, 2:58 p.m. UTC
char *buf is malloc()'d on initialization but not free()'d
in this control path.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 tools/progress.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stefano Babic Sept. 26, 2017, 3:15 p.m. UTC | #1
On 26/09/2017 16:58, Christian Storm wrote:
> char *buf is malloc()'d on initialization but not free()'d
> in this control path.
> 

Ouch...you're right !

> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>  tools/progress.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/progress.c b/tools/progress.c
> index 4db0b22..5b732f8 100644
> --- a/tools/progress.c
> +++ b/tools/progress.c
> @@ -161,6 +161,7 @@ static void psplash_progress(char *pipe, struct progress_msg *pmsg)
>  		return;
>  		break;
>  	case DONE:
> +		free(buf);
>  		return;
>  		break;
>  	default:
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano
diff mbox series

Patch

diff --git a/tools/progress.c b/tools/progress.c
index 4db0b22..5b732f8 100644
--- a/tools/progress.c
+++ b/tools/progress.c
@@ -161,6 +161,7 @@  static void psplash_progress(char *pipe, struct progress_msg *pmsg)
 		return;
 		break;
 	case DONE:
+		free(buf);
 		return;
 		break;
 	default: