Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
558e0a6f
Commit
558e0a6f
authored
Feb 21, 2007
by
Rémi Denis-Courmont
Browse files
Fix descriptor leak and remove useless code
parent
66438c4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/control/telnet.c
View file @
558e0a6f
...
...
@@ -251,20 +251,9 @@ static void Run( intf_thread_t *p_intf )
/* if a new client wants to communicate */
fd
=
net_Accept
(
p_intf
,
p_sys
->
pi_fd
,
p_sys
->
i_clients
>
0
?
0
:
-
1
);
if
(
fd
>
0
)
if
(
fd
!=
-
1
)
{
telnet_client_t
*
cl
=
NULL
;
/* to be non blocking */
#if defined( WIN32 ) || defined( UNDER_CE )
{
unsigned
long
i_dummy
=
1
;
ioctlsocket
(
fd
,
FIONBIO
,
&
i_dummy
);
}
#else
fcntl
(
fd
,
F_SETFL
,
O_NONBLOCK
);
#endif
cl
=
malloc
(
sizeof
(
telnet_client_t
));
telnet_client_t
*
cl
=
malloc
(
sizeof
(
telnet_client_t
));
if
(
cl
)
{
memset
(
cl
,
0
,
sizeof
(
telnet_client_t
)
);
...
...
@@ -279,7 +268,7 @@ static void Run( intf_thread_t *p_intf )
}
else
{
msg_Err
(
p_intf
,
"Out of mem"
);
net_Close
(
fd
);
continue
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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