From 46b67e93a5458ef50eebfeb6a16e1df417274003 Mon Sep 17 00:00:00 2001 From: Cathy Avery Date: Sun, 25 Apr 2021 14:54:39 -0400 Subject: [PATCH] Fix a memory leak reported by a partner from their Coverity scans. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Cathy Avery (cavery) RH-MergeRequest: 3: Fix a memory leak reported by a partner from their Coverity scans. RH-Commit: [1/1] 31c94232c885c6d902cae33720a063ab0de401ce RH-Bugzilla: 1935807 RH-Acked-by: Mohammed Gamal RH-Acked-by: Philippe Mathieu-Daudé commit 4f7441d8cd20923e509ff819084693bbd8c928df Author: John Wolfe Date: Thu Mar 25 20:21:17 2021 -0700 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1935807 Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=36406926 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 --- 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