]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix a memory leak reported by a partner from their Coverity scans.
authorJohn Wolfe <jwolfe@vmware.com>
Fri, 26 Mar 2021 03:21:17 +0000 (20:21 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Fri, 26 Mar 2021 03:21:17 +0000 (20:21 -0700)
open-vm-tools/vgauth/serviceImpl/saml-xmlsec1.c

index fbadee2c65a408ef49e9d83b9e25ab05a5a43b88..aaa5082ac5fb684d1389dda44617edd0ee0d5ddd 100644 (file)
@@ -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;
 }