Skip to content

Commit

Permalink
FileWatching: fix use-after-free (#24767)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash authored and JeffBezanson committed Nov 29, 2017
1 parent 578273a commit 46f88a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/FileWatching/src/FileWatching.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 46f88a2

Please sign in to comment.