Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] trace-cmd: Fix double free in tsync_agent_thread()
@ 2021-03-31 21:05 Steven Rostedt
  2021-03-31 21:48 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2021-03-31 21:05 UTC (permalink / raw)
  To: Linux Trace Devel

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

tracecmd_tsync_free() already frees the tsync, remove the free of it after
that is called.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 lib/trace-cmd/trace-timesync.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/trace-cmd/trace-timesync.c b/lib/trace-cmd/trace-timesync.c
index e860c335..ad73f08f 100644
--- a/lib/trace-cmd/trace-timesync.c
+++ b/lib/trace-cmd/trace-timesync.c
@@ -887,7 +887,6 @@ static void *tsync_agent_thread(void *data)
 out:
 	tracecmd_msg_handle_close(tsync->msg_handle);
 	tracecmd_tsync_free(tsync);
-	free(tsync);
 	close(sd);
 
 	pthread_exit(0);
-- 
2.29.2


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

* Re: [PATCH] trace-cmd: Fix double free in tsync_agent_thread()
  2021-03-31 21:05 [PATCH] trace-cmd: Fix double free in tsync_agent_thread() Steven Rostedt
@ 2021-03-31 21:48 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2021-03-31 21:48 UTC (permalink / raw)
  To: Linux Trace Devel

On Wed, 31 Mar 2021 17:05:03 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> 
> tracecmd_tsync_free() already frees the tsync, remove the free of it after
> that is called.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>  lib/trace-cmd/trace-timesync.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/lib/trace-cmd/trace-timesync.c b/lib/trace-cmd/trace-timesync.c
> index e860c335..ad73f08f 100644
> --- a/lib/trace-cmd/trace-timesync.c
> +++ b/lib/trace-cmd/trace-timesync.c
> @@ -887,7 +887,6 @@ static void *tsync_agent_thread(void *data)
>  out:
>  	tracecmd_msg_handle_close(tsync->msg_handle);
>  	tracecmd_tsync_free(tsync);
> -	free(tsync);
>  	close(sd);
>  

Debugging this more, this entire ending is wrong. New patch coming.

-- Steve

>  	pthread_exit(0);


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 21:05 [PATCH] trace-cmd: Fix double free in tsync_agent_thread() Steven Rostedt
2021-03-31 21:48 ` Steven Rostedt

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git