Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Update from nsfw/master to include memory leak fixes #8

Merged
merged 3 commits into from
Jun 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/linux/InotifyEventLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ void InotifyEventLoop::work() {
}

if (isDirectoryEvent) {
inotifyService->createDirectory(event->wd, strdup(event->name));
inotifyService->createDirectory(event->wd, event->name);
} else {
inotifyService->create(event->wd, strdup(event->name));
inotifyService->create(event->wd, event->name);
}
};

Expand All @@ -49,7 +49,7 @@ void InotifyEventLoop::work() {
return;
}

inotifyService->modify(event->wd, strdup(event->name));
inotifyService->modify(event->wd, event->name);
};

auto remove = [&event, &isDirectoryRemoval, &inotifyService]() {
Expand All @@ -60,7 +60,7 @@ void InotifyEventLoop::work() {
if (isDirectoryRemoval) {
inotifyService->removeDirectory(event->wd);
} else {
inotifyService->remove(event->wd, strdup(event->name));
inotifyService->remove(event->wd, event->name);
}
};

Expand Down Expand Up @@ -133,7 +133,7 @@ void InotifyEventLoop::work() {

renameStart();
} else if (event->mask & (uint32_t)IN_MOVE_SELF) {
inotifyService->remove(event->wd, strdup(event->name));
inotifyService->remove(event->wd, event->name);
inotifyService->removeDirectory(event->wd);
}
} while((position += sizeof(struct inotify_event) + event->len) < bytesRead);
Expand Down