aix: fix un-initialized pointer field in fs handle

On AIX, uv_fs_event_start() didn't always initialize
handle->dir_filename. In this scenario, uv_fs_event_stop()
would free the uninitialized pointer. This commit
initialized handle->dir_filename to NULL in all cases.

Fixes: https://github.com/nodejs/node/issues/13577
PR-URL: https://github.com/libuv/libuv/pull/1400
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Gireesh Punathil 2017-07-04 09:40:47 -04:00 committed by cjihrig
parent 4987b6325b
commit 09444560fe

View File

@ -855,6 +855,7 @@ int uv_fs_event_start(uv_fs_event_t* handle,
uv__io_init(&handle->event_watcher, uv__ahafs_event, fd);
handle->path = uv__strdup(filename);
handle->cb = cb;
handle->dir_filename = NULL;
uv__io_start(handle->loop, &handle->event_watcher, POLLIN);