Skip to content

Commit

Permalink
Fix use after free in kqueue backend
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Jan 25, 2025
1 parent de6f13d commit ab5da2f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/kqueue/KqueueBackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ void KqueueBackend::start() {
std::vector<KqueueSubscription *> subs = findSubscriptions(entry->path);
for (auto it = subs.begin(); it != subs.end(); it++) {
KqueueSubscription *sub = *it;
watchers.insert(sub->watcher);
if (flags & (NOTE_DELETE | NOTE_RENAME | NOTE_REVOKE)) {
sub->watcher->mEvents.remove(sub->path);
sub->tree->remove(sub->path);
Expand All @@ -96,8 +97,6 @@ void KqueueBackend::start() {
sub->watcher->mEvents.update(sub->path);
}
}

watchers.insert(sub->watcher);
}
}
}
Expand Down

0 comments on commit ab5da2f

Please sign in to comment.