]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Change to a common source file not directly applicable to open-vm-tools.
authorJohn Wolfe <jwolfe@vmware.com>
Mon, 7 Jun 2021 15:25:09 +0000 (08:25 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Mon, 7 Jun 2021 15:25:09 +0000 (08:25 -0700)
Adding a NULL pointer check.

open-vm-tools/lib/poll/poll.c

index da2db361dded4ed5c41b7e91174dd6085317db87..580b5c96f8ccab1c1e240c4c9352295b79bf2e9c 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 1998-2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-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
@@ -132,9 +132,10 @@ Poll_InitWithImpl(const PollImpl *impl)
 void
 Poll_Exit(void)
 {
-   pollImpl->Exit();
-
-   pollImpl = NULL;
+   if (pollImpl) {
+      pollImpl->Exit();
+      pollImpl = NULL;
+   }
 }