forked from QubesOS/qubes-core-libvirt
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update multiple IP address patch to the upstream accepted version
This include fix for memory leak. QubesOS/qubes-issues#718
- Loading branch information
Showing
3 changed files
with
129 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
patches.qubes/0026-xenMakeIPList-Don-t-leak-address_array.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From 34fb67efae1d0ab2bd7f6177308061c0970b8486 Mon Sep 17 00:00:00 2001 | ||
From: Michal Privoznik <mprivozn@redhat.com> | ||
Date: Tue, 12 Dec 2017 15:00:15 +0100 | ||
Subject: [PATCH] xenMakeIPList: Don't leak @address_array | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
Organization: Invisible Things Lab | ||
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | ||
|
||
==32171== 32 bytes in 1 blocks are definitely lost in loss record 44 of 107 | ||
==32171== at 0x4C2DEF6: calloc (vg_replace_malloc.c:711) | ||
==32171== by 0x55744A9: virAllocN (viralloc.c:191) | ||
==32171== by 0x12CED2: xenMakeIPList (xen_common.c:1186) | ||
==32171== by 0x12D0BE: xenFormatNet (xen_common.c:1221) | ||
==32171== by 0x12F0D2: xenFormatVif (xen_common.c:1889) | ||
==32171== by 0x12F2B4: xenFormatConfigCommon (xen_common.c:1944) | ||
==32171== by 0x13BA32: xenFormatXL (xen_xl.c:1971) | ||
==32171== by 0x1186CA: testCompareParseXML (xlconfigtest.c:105) | ||
==32171== by 0x118A64: testCompareHelper (xlconfigtest.c:205) | ||
==32171== by 0x119E36: virTestRun (testutils.c:180) | ||
==32171== by 0x11970E: mymain (xlconfigtest.c:301) | ||
==32171== by 0x11BEE3: virTestMain (testutils.c:1119) | ||
|
||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> | ||
Reviewed-by: John Ferlan <jferlan@redhat.com> | ||
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | ||
--- | ||
src/xenconfig/xen_common.c | 3 +-- | ||
1 file changed, 1 insertion(+), 2 deletions(-) | ||
|
||
diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c | ||
index 40b148321..ff0df5fb7 100644 | ||
--- a/src/xenconfig/xen_common.c | ||
+++ b/src/xenconfig/xen_common.c | ||
@@ -1196,8 +1196,7 @@ xenMakeIPList(virNetDevIPInfoPtr guestIP) | ||
ret = virStringListJoin((const char**)address_array, " "); | ||
|
||
cleanup: | ||
- while (i > 0) | ||
- VIR_FREE(address_array[--i]); | ||
+ virStringListFree(address_array); | ||
return ret; | ||
} | ||
|
||
-- | ||
2.13.6 | ||
|