win,fs: avoid double freeing uv_fs_event_t.dirw
Set `dirw` to `pathw` after `uv_fs_event_start` is known to be completed successfully. Fixes: https://github.com/libuv/libuv/issues/1221 PR-URL: https://github.com/libuv/libuv/pull/1222 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
309d603382
commit
02dcde0838
@ -188,7 +188,6 @@ int uv_fs_event_start(uv_fs_event_t* handle,
|
||||
|
||||
if (is_path_dir) {
|
||||
/* path is a directory, so that's the directory that we will watch. */
|
||||
handle->dirw = pathw;
|
||||
dir_to_watch = pathw;
|
||||
} else {
|
||||
/*
|
||||
@ -274,6 +273,8 @@ int uv_fs_event_start(uv_fs_event_t* handle,
|
||||
goto error;
|
||||
}
|
||||
|
||||
assert(is_path_dir ? pathw != NULL : pathw == NULL);
|
||||
handle->dirw = pathw;
|
||||
handle->req_pending = 1;
|
||||
return 0;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user