All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xenstore: free resp in do_control_help
@ 2017-03-01 11:07 Wei Liu
  2017-03-01 11:14 ` Juergen Gross
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2017-03-01 11:07 UTC (permalink / raw)
  To: Xen-devel; +Cc: Juergen Gross, Ian Jackson, Wei Liu

Coverity-ID: 1401603

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Juergen Gross <jgross@suse.com> 
---
 tools/xenstore/xenstored_control.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
index 7c149117b1..d99b7eb7f9 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -171,6 +171,8 @@ static int do_control_help(void *ctx, struct connection *conn,
 	resp[len] = 0;
 
 	send_reply(conn, XS_CONTROL, resp, len);
+
+	talloc_free(resp);
 	return 0;
 }
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH 1/2] xenstore: free resp in do_control_help
  2017-03-01 11:07 [PATCH 1/2] xenstore: free resp in do_control_help Wei Liu
@ 2017-03-01 11:14 ` Juergen Gross
  2017-03-01 11:17   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Juergen Gross @ 2017-03-01 11:14 UTC (permalink / raw)
  To: Wei Liu, Xen-devel; +Cc: Ian Jackson

On 01/03/17 12:07, Wei Liu wrote:
> Coverity-ID: 1401603
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Juergen Gross <jgross@suse.com> 
> ---
>  tools/xenstore/xenstored_control.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
> index 7c149117b1..d99b7eb7f9 100644
> --- a/tools/xenstore/xenstored_control.c
> +++ b/tools/xenstore/xenstored_control.c
> @@ -171,6 +171,8 @@ static int do_control_help(void *ctx, struct connection *conn,
>  	resp[len] = 0;
>  
>  	send_reply(conn, XS_CONTROL, resp, len);
> +
> +	talloc_free(resp);

Sorry, no. The context for the allocation is "in" which will be freed
automatically.


Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH 1/2] xenstore: free resp in do_control_help
  2017-03-01 11:14 ` Juergen Gross
@ 2017-03-01 11:17   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2017-03-01 11:17 UTC (permalink / raw)
  To: Juergen Gross; +Cc: Xen-devel, Wei Liu, Ian Jackson

On Wed, Mar 01, 2017 at 12:14:14PM +0100, Juergen Gross wrote:
> On 01/03/17 12:07, Wei Liu wrote:
> > Coverity-ID: 1401603
> > 
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > ---
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Juergen Gross <jgross@suse.com> 
> > ---
> >  tools/xenstore/xenstored_control.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
> > index 7c149117b1..d99b7eb7f9 100644
> > --- a/tools/xenstore/xenstored_control.c
> > +++ b/tools/xenstore/xenstored_control.c
> > @@ -171,6 +171,8 @@ static int do_control_help(void *ctx, struct connection *conn,
> >  	resp[len] = 0;
> >  
> >  	send_reply(conn, XS_CONTROL, resp, len);
> > +
> > +	talloc_free(resp);
> 
> Sorry, no. The context for the allocation is "in" which will be freed
> automatically.
> 

You're right. Coverity isn't smart enough to figure that out and I
missed it used the passed in ctx.

Ignore this patch.

Wei.

> 
> Juergen
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2017-03-01 11:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-01 11:07 [PATCH 1/2] xenstore: free resp in do_control_help Wei Liu
2017-03-01 11:14 ` Juergen Gross
2017-03-01 11:17   ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.