Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Daniel Kahn Gillmor
Knot DNS Resolver
Commits
95b243f0
Commit
95b243f0
authored
Jun 21, 2016
by
Marek Vavrusa
Browse files
daemon: fixed memleak on exit
fixes #77
parent
86f75f06
Changes
1
Hide whitespace changes
Inline
Side-by-side
daemon/main.c
View file @
95b243f0
...
...
@@ -53,6 +53,7 @@ static void tty_read(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
if
(
stream_fd
!=
STDIN_FILENO
)
{
if
(
nread
<=
0
)
{
/* Close if disconnected */
uv_close
((
uv_handle_t
*
)
stream
,
(
uv_close_cb
)
free
);
free
(
buf
->
base
);
return
;
}
uv_os_fd_t
dup_fd
=
dup
(
stream_fd
);
...
...
@@ -91,9 +92,9 @@ static void tty_read(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
fprintf
(
fp_out
,
"
\n
"
);
fprintf
(
fp_out
,
"%s"
,
delim
);
lua_settop
(
L
,
0
);
free
(
buf
->
base
);
}
fflush
(
out
);
free
(
buf
->
base
);
/* Close if redirected */
if
(
stream_fd
!=
STDIN_FILENO
)
{
fclose
(
out
);
/* outerr is the same */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment