open-vm-tools/ovt-Fix-a-memory-leak-repor...

70 lines
2.2 KiB
Diff

From 91bbbafc599978c5065879351715f452d2a003ea Mon Sep 17 00:00:00 2001
From: Cathy Avery <cavery@redhat.com>
Date: Sun, 25 Apr 2021 14:54:39 -0400
Subject: [PATCH] Fix a memory leak reported by a partner from their Coverity
scans.
RH-Author: Cathy Avery (cavery)
RH-MergeRequest: 4: Fix a memory leak reported by a partner from their Coverity scans.
RH-Commit: [1/1] 30a99cc22d39845f1fd272cf841c6a684f3174d4
RH-Bugzilla: 1954040
RH-Acked-by: Eduardo Otubo <otubo@redhat.com>
RH-Acked-by: Mohamed Gamal <mgamal@redhat.com>
commit 4f7441d8cd20923e509ff819084693bbd8c928df
Author: John Wolfe <jwolfe@vmware.com>
Date: Thu Mar 25 20:21:17 2021 -0700
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1954040
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=36472596
Tested: Tested by QE
Upstream Status: origin/devel
Conflicts: None
Fix a memory leak reported by a partner from their Coverity scans.
Signed-off-by: Cathy Avery <cavery@redhat.com>
---
open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c b/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c
index fbadee2c..aaa5082a 100644
--- a/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c
+++ b/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c
@@ -1,5 +1,5 @@
/*********************************************************
- * Copyright (C) 2016-2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2016-2021 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -872,7 +872,6 @@ VerifySubject(xmlDocPtr doc,
xmlNodePtr nameIDNode;
xmlNodePtr child;
gchar *subjectVal = NULL;
- gboolean retCode = FALSE;
gboolean validSubjectFound = FALSE;
xmlChar *tmp;
@@ -956,14 +955,13 @@ VerifySubject(xmlDocPtr doc,
}
}
+done:
if (validSubjectFound && (NULL != subjectRet)) {
*subjectRet = subjectVal;
} else {
g_free(subjectVal);
}
- retCode = validSubjectFound;
-done:
- return retCode;
+ return validSubjectFound;
}
--
2.27.0