@@ -38,9 +38,9 @@ void InotifyEventLoop::work() {
38
38
}
39
39
40
40
if (isDirectoryEvent) {
41
- inotifyService->createDirectory (event->wd , strdup ( event->name ) );
41
+ inotifyService->createDirectory (event->wd , event->name );
42
42
} else {
43
- inotifyService->create (event->wd , strdup ( event->name ) );
43
+ inotifyService->create (event->wd , event->name );
44
44
}
45
45
};
46
46
@@ -49,7 +49,7 @@ void InotifyEventLoop::work() {
49
49
return ;
50
50
}
51
51
52
- inotifyService->modify (event->wd , strdup ( event->name ) );
52
+ inotifyService->modify (event->wd , event->name );
53
53
};
54
54
55
55
auto remove = [&event, &isDirectoryRemoval, &inotifyService]() {
@@ -60,7 +60,7 @@ void InotifyEventLoop::work() {
60
60
if (isDirectoryRemoval) {
61
61
inotifyService->removeDirectory (event->wd );
62
62
} else {
63
- inotifyService->remove (event->wd , strdup ( event->name ) );
63
+ inotifyService->remove (event->wd , event->name );
64
64
}
65
65
};
66
66
@@ -133,7 +133,7 @@ void InotifyEventLoop::work() {
133
133
134
134
renameStart ();
135
135
} else if (event->mask & (uint32_t )IN_MOVE_SELF) {
136
- inotifyService->remove (event->wd , strdup ( event->name ) );
136
+ inotifyService->remove (event->wd , event->name );
137
137
inotifyService->removeDirectory (event->wd );
138
138
}
139
139
} while ((position += sizeof (struct inotify_event ) + event->len ) < bytesRead);
0 commit comments