Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
c80f00f9
Commit
c80f00f9
authored
Jan 17, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/control/http.c: fixed a whole bunch of mem leaks.
parent
f083827e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
13 deletions
+31
-13
modules/control/http.c
modules/control/http.c
+31
-13
No files found.
modules/control/http.c
View file @
c80f00f9
...
...
@@ -2,7 +2,7 @@
* http.c : http mini-server ;)
*****************************************************************************
* Copyright (C) 2001-2004 VideoLAN
* $Id: http.c,v 1.4
4 2004/01/17 12:28:57
gbazin Exp $
* $Id: http.c,v 1.4
5 2004/01/17 13:25:21
gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Laurent Aimar <fenrir@via.ecp.fr>
...
...
@@ -297,10 +297,12 @@ static int Activate( vlc_object_t *p_this )
goto
failed
;
}
p_intf
->
pf_run
=
Run
;
free
(
psz_src
);
return
VLC_SUCCESS
;
failed:
if
(
psz_src
)
free
(
psz_src
);
free
(
p_sys
->
pp_files
);
p_sys
->
p_httpd
->
pf_unregister_host
(
p_sys
->
p_httpd
,
p_sys
->
p_httpd_host
);
...
...
@@ -585,6 +587,7 @@ static int ParseDirectory( intf_thread_t *p_intf, char *psz_root,
if
(
!
f
)
{
msg_Err
(
p_intf
,
"Out of memory"
);
closedir
(
p_dir
);
return
(
VLC_ENOMEM
);
}
f
->
p_intf
=
p_intf
;
...
...
@@ -595,6 +598,7 @@ static int ParseDirectory( intf_thread_t *p_intf, char *psz_root,
if
(
!
f
->
name
||
!
f
->
mime
)
{
msg_Err
(
p_intf
,
"Unable to parse directory"
);
closedir
(
p_dir
);
return
(
VLC_ENOMEM
);
}
msg_Dbg
(
p_intf
,
"file=%s (url=%s mime=%s)"
,
...
...
@@ -622,6 +626,7 @@ static int ParseDirectory( intf_thread_t *p_intf, char *psz_root,
if
(
!
f
)
{
msg_Err
(
p_intf
,
"Out of memory"
);
closedir
(
p_dir
);
return
(
VLC_ENOMEM
);
}
f
->
p_intf
=
p_intf
;
...
...
@@ -659,6 +664,9 @@ static int ParseDirectory( intf_thread_t *p_intf, char *psz_root,
{
free
(
password
);
}
closedir
(
p_dir
);
return
VLC_SUCCESS
;
}
...
...
@@ -1966,6 +1974,7 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
case
MVLC_STRING
:
psz
=
config_GetPsz
(
p_intf
,
m
->
param1
);
sprintf
(
value
,
"%s"
,
psz
?
psz
:
""
);
if
(
psz
)
free
(
psz
);
break
;
default:
sprintf
(
value
,
"invalid type(%s) in set"
,
m
->
param2
);
...
...
@@ -2037,6 +2046,8 @@ static uint8_t *MacroSearch( uint8_t *src, uint8_t *end, int i_mvlc, vlc_bool_t
break
;
}
MacroClean
(
&
m
);
if
(
(
i_mvlc
==
MVLC_END
&&
i_level
==
-
1
)
||
(
i_mvlc
!=
MVLC_END
&&
i_level
==
0
&&
i_mvlc
==
i_id
)
)
{
...
...
@@ -2910,13 +2921,18 @@ playlist_item_t * parse_MRL( char *psz )
if
(
s_temp
==
NULL
)
{
i_error
=
1
;
}
else
}
else
{
i_options
++
;
ppsz_options
=
(
char
**
)
realloc
(
ppsz_options
,
i_options
*
sizeof
(
char
*
)
);
ppsz_options
[
i_options
-
1
]
=
(
char
*
)
malloc
(
(
s_temp
-
s_mrl
+
1
)
*
sizeof
(
char
)
);
ppsz_options
=
realloc
(
ppsz_options
,
i_options
*
sizeof
(
char
*
)
);
ppsz_options
[
i_options
-
1
]
=
malloc
(
(
s_temp
-
s_mrl
+
1
)
*
sizeof
(
char
)
);
strncpy
(
ppsz_options
[
i_options
-
1
]
,
s_mrl
,
s_temp
-
s_mrl
);
strncpy
(
ppsz_options
[
i_options
-
1
]
,
s_mrl
,
s_temp
-
s_mrl
);
/* don't forget to finish the string with a '\0' */
(
ppsz_options
[
i_options
-
1
])[
s_temp
-
s_mrl
]
=
'\0'
;
...
...
@@ -2935,13 +2951,8 @@ playlist_item_t * parse_MRL( char *psz )
if
(
i_error
!=
0
)
{
free
(
mrl
);
for
(
i
=
0
;
i
<
i_options
;
i
++
)
{
free
(
ppsz_options
[
i
]
);
}
free
(
ppsz_options
);
return
NULL
;
}
else
}
else
{
/* now create an item */
p_item
=
malloc
(
sizeof
(
playlist_item_t
)
);
...
...
@@ -2956,7 +2967,14 @@ playlist_item_t * parse_MRL( char *psz )
{
playlist_AddItemOption
(
p_item
,
ppsz_options
[
i
]
);
}
}
return
p_item
;
for
(
i
=
0
;
i
<
i_options
;
i
++
)
{
free
(
ppsz_options
[
i
]
);
}
free
(
ppsz_options
);
if
(
i_error
!=
0
)
return
NULL
;
else
return
p_item
;
}
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