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
e7254d38
Commit
e7254d38
authored
Oct 02, 2009
by
ivoire
Browse files
sout_std: fix potential memleaks.
parent
d8fe1e81
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/stream_out/standard.c
View file @
e7254d38
...
...
@@ -213,16 +213,20 @@ static int Open( vlc_object_t *p_this )
psz_bind
=
var_GetNonEmptyString
(
p_stream
,
SOUT_CFG_PREFIX
"bind"
);
psz_path
=
var_GetNonEmptyString
(
p_stream
,
SOUT_CFG_PREFIX
"path"
);
if
(
psz_bind
)
psz_url
=
psz_bind
;
if
(
psz_url
&&
psz_path
)
if
(
psz_bind
&&
psz_path
)
{
if
(
asprintf
(
&
psz_url
,
"%s/%s"
,
psz_
url
,
psz_path
)
==
-
1
)
if
(
asprintf
(
&
psz_url
,
"%s/%s"
,
psz_
bind
,
psz_path
)
==
-
1
)
psz_url
=
NULL
;
free
(
psz_path
);
}
else
if
(
psz_bind
)
{
psz_url
=
psz_bind
;
psz_bind
=
NULL
;
}
free
(
psz_path
);
var_Get
(
p_stream
,
SOUT_CFG_PREFIX
"dst"
,
&
val
);
if
(
*
val
.
psz_string
)
if
(
*
val
.
psz_string
)
{
free
(
psz_url
);
psz_url
=
val
.
psz_string
;
...
...
@@ -233,6 +237,9 @@ static int Open( vlc_object_t *p_this )
p_sys
=
p_stream
->
p_sys
=
malloc
(
sizeof
(
sout_stream_sys_t
)
);
if
(
!
p_sys
)
{
free
(
psz_access
);
free
(
psz_mux
);
free
(
psz_bind
);
free
(
psz_url
);
return
VLC_ENOMEM
;
}
...
...
@@ -296,6 +303,7 @@ static int Open( vlc_object_t *p_this )
else
{
msg_Err
(
p_stream
,
"no access _and_ no muxer (fatal error)"
);
free
(
psz_bind
);
free
(
psz_url
);
free
(
p_sys
);
return
VLC_EGENERIC
;
...
...
@@ -320,6 +328,9 @@ static int Open( vlc_object_t *p_this )
else
{
msg_Err
(
p_stream
,
"no mux specified or found by extension"
);
free
(
psz_access
);
free
(
psz_bind
);
free
(
psz_url
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -389,6 +400,7 @@ static int Open( vlc_object_t *p_this )
psz_access
,
psz_mux
,
psz_url
);
free
(
psz_access
);
free
(
psz_mux
);
free
(
psz_bind
);
free
(
psz_url
);
free
(
p_sys
);
return
VLC_EGENERIC
;
...
...
@@ -405,6 +417,7 @@ static int Open( vlc_object_t *p_this )
sout_AccessOutDelete
(
p_access
);
free
(
psz_access
);
free
(
psz_mux
);
free
(
psz_bind
);
free
(
psz_url
);
free
(
p_sys
);
return
VLC_EGENERIC
;
...
...
@@ -477,6 +490,7 @@ static int Open( vlc_object_t *p_this )
free
(
psz_access
);
free
(
psz_mux
);
free
(
psz_bind
);
free
(
psz_url
);
if
(
!
sout_AccessOutCanControlPace
(
p_access
)
)
...
...
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