You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by af...@apache.org on 2018/02/20 22:38:09 UTC
zookeeper git commit: ZOOKEEPER-2978: fix potential null pointer
exception when deleting node
Repository: zookeeper
Updated Branches:
refs/heads/master bebe4162b -> f0b67b6e4
ZOOKEEPER-2978: fix potential null pointer exception when deleting node
At line 518, 'existWatches.remove(clientPath)' is null because watches for clientPath is already removed.
Author: 07c00h <07...@gmail.com>
Reviewers: Abraham Fine <af...@apache.org>
Closes #461 from achimbab/master
Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/f0b67b6e
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/f0b67b6e
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/f0b67b6e
Branch: refs/heads/master
Commit: f0b67b6e49acec5f022bee25e08f82a29572c97a
Parents: bebe416
Author: achimbab <07...@gmail.com>
Authored: Tue Feb 20 14:38:00 2018 -0800
Committer: Abraham Fine <af...@apache.org>
Committed: Tue Feb 20 14:38:00 2018 -0800
----------------------------------------------------------------------
src/java/main/org/apache/zookeeper/ZooKeeper.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/f0b67b6e/src/java/main/org/apache/zookeeper/ZooKeeper.java
----------------------------------------------------------------------
diff --git a/src/java/main/org/apache/zookeeper/ZooKeeper.java b/src/java/main/org/apache/zookeeper/ZooKeeper.java
index d24404f..0967b0a 100644
--- a/src/java/main/org/apache/zookeeper/ZooKeeper.java
+++ b/src/java/main/org/apache/zookeeper/ZooKeeper.java
@@ -515,7 +515,7 @@ public class ZooKeeper implements AutoCloseable {
synchronized (existWatches) {
Set<Watcher> list = existWatches.remove(clientPath);
if (list != null) {
- addTo(existWatches.remove(clientPath), result);
+ addTo(list, result);
LOG.warn("We are triggering an exists watch for delete! Shouldn't happen!");
}
}