From: John Wolfe Date: Fri, 26 Mar 2021 03:21:17 +0000 (-0700) Subject: Fix a memory leak reported by a partner from their Coverity scans. X-Git-Tag: stable-11.3.0~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f7441d8cd20923e509ff819084693bbd8c928df;p=thirdparty%2Fopen-vm-tools.git Fix a memory leak reported by a partner from their Coverity scans. --- diff --git a/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c b/open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c index fbadee2c6..aaa5082ac 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; }