]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix a trivial Coverity-reported memory leak.
authorOliver Kurth <okurth@vmware.com>
Wed, 8 May 2019 22:27:19 +0000 (15:27 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 8 May 2019 22:27:19 +0000 (15:27 -0700)
If AuthLoadPAM doesn't find all the needed symbols from the pam
library, then dlclose the library, as is already done for
the same-named funtion in bora/lib/auth/authPosix.c.

open-vm-tools/vgauth/lib/authPosix.c

index dfaeb92ba03300d7486e03a928c4da0c99e8410e..151e59528abbdc9618dce54a9bf299bc511b5050 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2017,2019 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
@@ -128,7 +128,7 @@ AuthLoadPAM(void)
       if (!symbol) {
          Warning("PAM library does not contain required function: %s\n",
                  dlerror());
-
+         dlclose(pam_library);
          return FALSE;
       }