qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH V2] net/colo-compare: Fix memory free error
@ 2017-02-22  5:16 Zhang Chen
  2017-02-22  8:08 ` Jason Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Chen @ 2017-02-22  5:16 UTC (permalink / raw)
  To: qemu devel; +Cc: Jason Wang, Zhang Chen

We use g_queue_init() to init s->conn_list, so we should use g_queue_clear()
to instead of g_queue_free().

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
---
 net/colo-compare.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index a6fc2ff..300f017 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -729,7 +729,7 @@ static void colo_compare_finalize(Object *obj)
     /* Release all unhandled packets after compare thead exited */
     g_queue_foreach(&s->conn_list, colo_flush_packets, s);
 
-    g_queue_free(&s->conn_list);
+    g_queue_clear(&s->conn_list);
 
     g_hash_table_destroy(s->connection_track_table);
     g_free(s->pri_indev);
-- 
2.7.4

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

* Re: [Qemu-devel] [PATCH V2] net/colo-compare: Fix memory free error
  2017-02-22  5:16 [Qemu-devel] [PATCH V2] net/colo-compare: Fix memory free error Zhang Chen
@ 2017-02-22  8:08 ` Jason Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Wang @ 2017-02-22  8:08 UTC (permalink / raw)
  To: Zhang Chen, qemu devel



On 2017年02月22日 13:16, Zhang Chen wrote:
> We use g_queue_init() to init s->conn_list, so we should use g_queue_clear()
> to instead of g_queue_free().
>
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
> Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> ---
>   net/colo-compare.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

>
> diff --git a/net/colo-compare.c b/net/colo-compare.c
> index a6fc2ff..300f017 100644
> --- a/net/colo-compare.c
> +++ b/net/colo-compare.c
> @@ -729,7 +729,7 @@ static void colo_compare_finalize(Object *obj)
>       /* Release all unhandled packets after compare thead exited */
>       g_queue_foreach(&s->conn_list, colo_flush_packets, s);
>   
> -    g_queue_free(&s->conn_list);
> +    g_queue_clear(&s->conn_list);
>   
>       g_hash_table_destroy(s->connection_track_table);
>       g_free(s->pri_indev);

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

end of thread, other threads:[~2017-02-22  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-22  5:16 [Qemu-devel] [PATCH V2] net/colo-compare: Fix memory free error Zhang Chen
2017-02-22  8:08 ` Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).