|
|
a5acde |
From 54da2ccfa99000a62f22820a3702331bbd131077 Mon Sep 17 00:00:00 2001
|
|
|
a5acde |
From: Cathy Avery <cavery@redhat.com>
|
|
|
a5acde |
Date: Tue, 19 Nov 2019 14:16:06 +0100
|
|
|
a5acde |
Subject: [PATCH 3/3] Fix leaks in ListAliases and ListMappedAliases
|
|
|
a5acde |
(9bc72f0b09702754b429115658a85223cb3058bd from devel)
|
|
|
a5acde |
|
|
|
a5acde |
RH-Author: Cathy Avery <cavery@redhat.com>
|
|
|
a5acde |
Message-id: <20191119141606.5322-4-cavery@redhat.com>
|
|
|
a5acde |
Patchwork-id: 92513
|
|
|
a5acde |
O-Subject: [RHEL8.1.z open-vm-tools PATCH 3/3] Fix leaks in ListAliases and ListMappedAliases (9bc72f0b09702754b429115658a85223cb3058bd from devel)
|
|
|
a5acde |
Bugzilla: 1773903
|
|
|
a5acde |
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
|
|
a5acde |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
a5acde |
|
|
|
a5acde |
commit 26b9edbeb79d1c67b9ae73a0c97c48999c1fb503 (origin/stable-10.3.10-vix-memory-leaks)
|
|
|
a5acde |
Author: Oliver Kurth <okurth@vmware.com>
|
|
|
a5acde |
Date: Wed Oct 2 17:48:35 2019 -0700
|
|
|
a5acde |
|
|
|
a5acde |
Fix leaks in ListAliases and ListMappedAliases (9bc72f0b09702754b429115658a85223cb3058bd from devel)
|
|
|
a5acde |
|
|
|
a5acde |
Signed-off-by: Cathy Avery <cavery@redhat.com>
|
|
|
a5acde |
|
|
|
a5acde |
Conflicts: Previous coverity patch commit d477b6e21915d5099018f4fc4b60f257bb593d72
|
|
|
a5acde |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
a5acde |
---
|
|
|
a5acde |
services/plugins/vix/vixTools.c | 10 ++++++++--
|
|
|
a5acde |
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
a5acde |
|
|
|
a5acde |
diff --git a/services/plugins/vix/vixTools.c b/services/plugins/vix/vixTools.c
|
|
|
a5acde |
index 7df91de..2b9dede 100644
|
|
|
a5acde |
--- a/services/plugins/vix/vixTools.c
|
|
|
a5acde |
+++ b/services/plugins/vix/vixTools.c
|
|
|
a5acde |
@@ -9620,7 +9620,6 @@ VixToolsListAuthAliases(VixCommandRequestHeader *requestMsg, // IN
|
|
|
a5acde |
char *destPtr;
|
|
|
a5acde |
char *endDestPtr;
|
|
|
a5acde |
char *tmpBuf = NULL;
|
|
|
a5acde |
- char *recordBuf;
|
|
|
a5acde |
size_t recordSize;
|
|
|
a5acde |
char *escapedStr = NULL;
|
|
|
a5acde |
char *escapedStr2 = NULL;
|
|
|
a5acde |
@@ -9679,6 +9678,8 @@ VixToolsListAuthAliases(VixCommandRequestHeader *requestMsg, // IN
|
|
|
a5acde |
destPtr += Str_Sprintf(destPtr, endDestPtr - destPtr, "%s",
|
|
|
a5acde |
VIX_XML_ESCAPED_TAG);
|
|
|
a5acde |
for (i = 0; i < num; i++) {
|
|
|
a5acde |
+ char *recordBuf = NULL;
|
|
|
a5acde |
+
|
|
|
a5acde |
escapedStr = VixToolsEscapeXMLString(uaList[i].pemCert);
|
|
|
a5acde |
if (escapedStr == NULL) {
|
|
|
a5acde |
err = VIX_E_OUT_OF_MEMORY;
|
|
|
a5acde |
@@ -9752,6 +9753,8 @@ VixToolsListAuthAliases(VixCommandRequestHeader *requestMsg, // IN
|
|
|
a5acde |
Log("%s: ListAuth list results too large, truncating", __FUNCTION__);
|
|
|
a5acde |
goto abort;
|
|
|
a5acde |
}
|
|
|
a5acde |
+ free(recordBuf);
|
|
|
a5acde |
+ recordBuf = NULL;
|
|
|
a5acde |
}
|
|
|
a5acde |
|
|
|
a5acde |
*result = resultBuffer;
|
|
|
a5acde |
@@ -9817,7 +9820,6 @@ VixToolsListMappedAliases(VixCommandRequestHeader *requestMsg, // IN
|
|
|
a5acde |
char *destPtr;
|
|
|
a5acde |
char *endDestPtr;
|
|
|
a5acde |
char *tmpBuf = NULL;
|
|
|
a5acde |
- char *recordBuf;
|
|
|
a5acde |
char *escapedStr = NULL;
|
|
|
a5acde |
char *escapedStr2 = NULL;
|
|
|
a5acde |
size_t recordSize;
|
|
|
a5acde |
@@ -9870,6 +9872,8 @@ VixToolsListMappedAliases(VixCommandRequestHeader *requestMsg, // IN
|
|
|
a5acde |
destPtr += Str_Sprintf(destPtr, endDestPtr - destPtr, "%s",
|
|
|
a5acde |
VIX_XML_ESCAPED_TAG);
|
|
|
a5acde |
for (i = 0; i < num; i++) {
|
|
|
a5acde |
+ char *recordBuf = NULL;
|
|
|
a5acde |
+
|
|
|
a5acde |
escapedStr = VixToolsEscapeXMLString(maList[i].pemCert);
|
|
|
a5acde |
if (escapedStr == NULL) {
|
|
|
a5acde |
err = VIX_E_OUT_OF_MEMORY;
|
|
|
a5acde |
@@ -9941,6 +9945,8 @@ VixToolsListMappedAliases(VixCommandRequestHeader *requestMsg, // IN
|
|
|
a5acde |
Log("%s: ListMapped results too large, truncating", __FUNCTION__);
|
|
|
a5acde |
goto abort;
|
|
|
a5acde |
}
|
|
|
a5acde |
+ free(recordBuf);
|
|
|
a5acde |
+ recordBuf = NULL;
|
|
|
a5acde |
}
|
|
|
a5acde |
|
|
|
a5acde |
*result = resultBuffer;
|
|
|
a5acde |
--
|
|
|
a5acde |
1.8.3.1
|
|
|
a5acde |
|