All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Straub <lukasstraub2@web.de>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Zhang Chen <chen.zhang@intel.com>,
	Jason Wang <jasowang@redhat.com>,
	Li Zhijian <lizhijian@cn.fujitsu.com>
Subject: [PATCH 1/2] net/colo-compare.c: Fix memory leak for non-tcp packet
Date: Sun, 15 Nov 2020 12:19:02 +0100	[thread overview]
Message-ID: <af6051bf9a72151cfc5e7ec8c72dedd30ef6b332.1605438886.git.lukasstraub2@web.de> (raw)
In-Reply-To: <cover.1605438886.git.lukasstraub2@web.de>

[-- Attachment #1: Type: text/plain, Size: 679 bytes --]

Additional to removing the packet from the secondary queue,
we also need to free it.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
---
 net/colo-compare.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index 337025b44f..eed0fbb27b 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -690,6 +690,7 @@ static void colo_compare_packet(CompareState *s, Connection *conn,

         if (result) {
             colo_release_primary_pkt(s, pkt);
+            packet_destroy(result->data, NULL);
             g_queue_remove(&conn->secondary_list, result->data);
         } else {
             /*
--
2.20.1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-11-15 11:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-15 11:18 [PATCH 0/2] colo-compare: Fix memory leak for non-tcp packet Lukas Straub
2020-11-15 11:19 ` Lukas Straub [this message]
2020-11-16  7:31   ` [PATCH 1/2] net/colo-compare.c: " Zhang, Chen
2020-11-15 11:19 ` [PATCH 2/2] net/colo-compare.c: Optimize removal of secondary packet Lukas Straub
2020-11-16  7:31   ` Zhang, Chen
2020-11-16  7:32 ` [PATCH 0/2] colo-compare: Fix memory leak for non-tcp packet Zhang, Chen
2021-03-17 21:23   ` Lukas Straub
2021-03-18  1:22     ` Zhang, Chen
2021-03-18  2:41       ` Jason Wang
2021-03-18  3:26         ` Zhang, Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=af6051bf9a72151cfc5e7ec8c72dedd30ef6b332.1605438886.git.lukasstraub2@web.de \
    --to=lukasstraub2@web.de \
    --cc=chen.zhang@intel.com \
    --cc=jasowang@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.