From 46f88a2c3d0f2794e52d27eaaeeac10195969db3 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 29 Nov 2017 14:56:28 -0500 Subject: [PATCH] FileWatching: fix use-after-free (#24767) --- stdlib/FileWatching/src/FileWatching.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/FileWatching/src/FileWatching.jl b/stdlib/FileWatching/src/FileWatching.jl index 1945fbd29e9b7..8512cae6b9e2b 100644 --- a/stdlib/FileWatching/src/FileWatching.jl +++ b/stdlib/FileWatching/src/FileWatching.jl @@ -191,11 +191,11 @@ mutable struct _FDWatcher associate_julia_struct(handle, this) err = ccall(:uv_poll_init_socket, Int32, (Ptr{Void}, Ptr{Void}, Ptr{Void}), eventloop(), handle, fd.handle) - finalizer(uvfinalize, this) if err != 0 Libc.free(handle) throw(UVError("FDWatcher", err)) end + finalizer(uvfinalize, this) return this end end