xenstore: free resp in do_control_help
PATCH 1/2 xenstore: free resp in do_control_help
Coverity-ID: 1401603
---
Cc: Ian Jackson <[email protected]>
Cc: Juergen Gross <[email protected]>
--- tools/xenstore/xenstored_control.c | 2 ++ 1 file changed, 2 insertions(+)
tools/xenstore/xenstored_control.c +2 -0
@@ -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 ; }
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 15 lines · Wei Liu
Coverity-ID: 1401603
Signed-off-by Wei Liu <[email protected]>---
Cc: Ian Jackson <[email protected]>
Cc: Juergen Gross <[email protected]>--- tools/xenstore/xenstored_control.c | 2 ++ 1 file changed, 2 insertions(+)tools/xenstore/xenstored_control.c +0
-0
tools/xenstore/xenstored_control.c static int do_control_help(void *ctx, struct connection *conn, · line 175
Quoted 5 lines
tools/xenstore/xenstored_control.c +2
-0@@ -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
[email protected]
https://lists.xen.org/xen-devel
Quoted 18 lines · Juergen Gross
Quoted 17 lines · Wei Liu
Coverity-ID: 1401603
Signed-off-by Wei Liu <[email protected]>---
Cc: Ian Jackson <[email protected]>
Cc: Juergen Gross <[email protected]>--- tools/xenstore/xenstored_control.c | 2 ++ 1 file changed, 2 insertions(+)tools/xenstore/xenstored_control.c +0
-0@@ -171,6 +171,8 @@ static int do_control_help(void *ctx, struct connection *conn, resp[len] =0 ;
Quoted 7 lines
tools/xenstore/xenstored_control.c static int do_control_help(void *ctx, struct connection *conn, · line 175
Quoted 3 lines
tools/xenstore/xenstored_control.c +2
-0send_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.
Quoted 3 lines
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel