Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
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
Show 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 )
...
@@ -186,18 +186,24 @@ static int Open( vlc_object_t *p_this )
psz_address
=
config_GetPsz
(
p_intf
,
"telnet-host"
);
psz_address
=
config_GetPsz
(
p_intf
,
"telnet-host"
);
vlc_UrlParse
(
&
url
,
psz_address
,
0
);
vlc_UrlParse
(
&
url
,
psz_address
,
0
);
free
(
psz_address
);
// There might be two ports given, resolve any potentially
// There might be two ports given, resolve any potentially
// conflict
// conflict
url
.
i_port
=
getPort
(
p_intf
,
url
,
i_telnetport
);
url
.
i_port
=
getPort
(
p_intf
,
url
,
i_telnetport
);
p_intf
->
p_sys
=
malloc
(
sizeof
(
intf_sys_t
)
);
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
)
)
if
(
!
p_intf
->
p_sys
)
==
NULL
)
{
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"
);
msg_Err
(
p_intf
,
"cannot listen for telnet"
);
vl
c_UrlClean
(
&
url
);
vl
m_Delete
(
p_intf
->
p_sys
->
mediatheque
);
free
(
psz_address
);
vlc_UrlClean
(
&
url
);
free
(
p_intf
->
p_sys
);
free
(
p_intf
->
p_sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -210,8 +216,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -210,8 +216,7 @@ static int Open( vlc_object_t *p_this )
p_intf
->
p_sys
->
mediatheque
=
mediatheque
;
p_intf
->
p_sys
->
mediatheque
=
mediatheque
;
p_intf
->
pf_run
=
Run
;
p_intf
->
pf_run
=
Run
;
vlc_UrlClean
(
&
url
);
vlc_UrlClean
(
&
url
);
free
(
psz_address
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
@@ -228,8 +233,8 @@ static void Close( vlc_object_t *p_this )
...
@@ -228,8 +233,8 @@ static void Close( vlc_object_t *p_this )
{
{
telnet_client_t
*
cl
=
p_sys
->
clients
[
i
];
telnet_client_t
*
cl
=
p_sys
->
clients
[
i
];
net_Close
(
cl
->
fd
);
net_Close
(
cl
->
fd
);
free
(
cl
->
buffer_write
);
free
(
cl
);
free
(
cl
);
p_sys
->
clients
[
i
]
=
NULL
;
}
}
free
(
p_sys
->
clients
);
free
(
p_sys
->
clients
);
...
@@ -419,6 +424,7 @@ static void Run( intf_thread_t *p_intf )
...
@@ -419,6 +424,7 @@ static void Run( intf_thread_t *p_intf )
net_Close
(
cl
->
fd
);
net_Close
(
cl
->
fd
);
TAB_REMOVE
(
p_intf
->
p_sys
->
i_clients
,
TAB_REMOVE
(
p_intf
->
p_sys
->
i_clients
,
p_intf
->
p_sys
->
clients
,
cl
);
p_intf
->
p_sys
->
clients
,
cl
);
free
(
cl
->
buffer_write
);
free
(
cl
);
free
(
cl
);
}
}
else
if
(
!
strncmp
(
cl
->
buffer_read
,
"shutdown"
,
8
)
)
else
if
(
!
strncmp
(
cl
->
buffer_read
,
"shutdown"
,
8
)
)
...
@@ -482,7 +488,6 @@ static void Run( intf_thread_t *p_intf )
...
@@ -482,7 +488,6 @@ static void Run( intf_thread_t *p_intf )
}
}
Write_message
(
cl
,
message
,
NULL
,
WRITE_MODE_CMD
);
Write_message
(
cl
,
message
,
NULL
,
WRITE_MODE_CMD
);
vlm_MessageDelete
(
message
);
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