Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
70db1cf5
Commit
70db1cf5
authored
Aug 20, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a memleak when a connection is closed.
parent
fc1e5cd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
modules/control/telnet.c
modules/control/telnet.c
+13
-8
No files found.
modules/control/telnet.c
View file @
70db1cf5
...
...
@@ -186,18 +186,24 @@ static int Open( vlc_object_t *p_this )
psz_address
=
config_GetPsz
(
p_intf
,
"telnet-host"
);
vlc_UrlParse
(
&
url
,
psz_address
,
0
);
free
(
psz_address
);
// There might be two ports given, resolve any potentially
// conflict
url
.
i_port
=
getPort
(
p_intf
,
url
,
i_telnetport
);
p_intf
->
p_sys
=
malloc
(
sizeof
(
intf_sys_t
)
);
if
(
(
p_intf
->
p_sys
->
pi_fd
=
net_ListenTCP
(
p_intf
,
url
.
psz_host
,
url
.
i_port
)
)
==
NULL
)
if
(
!
p_intf
->
p_sys
)
{
vlm_Delete
(
p_intf
->
p_sys
->
mediatheque
);
vlc_UrlClean
(
&
url
);
return
VLC_ENOMEM
;
}
if
(
(
p_intf
->
p_sys
->
pi_fd
=
net_ListenTCP
(
p_intf
,
url
.
psz_host
,
url
.
i_port
)
)
==
NULL
)
{
msg_Err
(
p_intf
,
"cannot listen for telnet"
);
vl
c_UrlClean
(
&
url
);
free
(
psz_address
);
vl
m_Delete
(
p_intf
->
p_sys
->
mediatheque
);
vlc_UrlClean
(
&
url
);
free
(
p_intf
->
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -210,8 +216,7 @@ static int Open( vlc_object_t *p_this )
p_intf
->
p_sys
->
mediatheque
=
mediatheque
;
p_intf
->
pf_run
=
Run
;
vlc_UrlClean
(
&
url
);
free
(
psz_address
);
vlc_UrlClean
(
&
url
);
return
VLC_SUCCESS
;
}
...
...
@@ -228,8 +233,8 @@ static void Close( vlc_object_t *p_this )
{
telnet_client_t
*
cl
=
p_sys
->
clients
[
i
];
net_Close
(
cl
->
fd
);
free
(
cl
->
buffer_write
);
free
(
cl
);
p_sys
->
clients
[
i
]
=
NULL
;
}
free
(
p_sys
->
clients
);
...
...
@@ -419,6 +424,7 @@ static void Run( intf_thread_t *p_intf )
net_Close
(
cl
->
fd
);
TAB_REMOVE
(
p_intf
->
p_sys
->
i_clients
,
p_intf
->
p_sys
->
clients
,
cl
);
free
(
cl
->
buffer_write
);
free
(
cl
);
}
else
if
(
!
strncmp
(
cl
->
buffer_read
,
"shutdown"
,
8
)
)
...
...
@@ -482,7 +488,6 @@ static void Run( intf_thread_t *p_intf )
}
Write_message
(
cl
,
message
,
NULL
,
WRITE_MODE_CMD
);
vlm_MessageDelete
(
message
);
}
}
}
...
...
Write
Preview
Markdown
is supported
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