Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marvin Scholz
Icecast-Server
Commits
59b605ec
Commit
59b605ec
authored
May 03, 2002
by
Michael Smith
Browse files
Memory leaks. Lots of little ones.
svn path=/trunk/httpp/; revision=3275
parent
0dbd488c
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/config.c
View file @
59b605ec
...
...
@@ -48,8 +48,9 @@ void config_initialize(void)
void
config_shutdown
(
void
)
{
i
f
(
_config_
filename
)
free
(
_config_filename
)
;
i
ce
_config_
dir_t
*
dirnode
,
*
nextdirnode
;
if
(
_config_filename
)
free
(
_config_filename
);
if
(
_configuration
.
location
)
free
(
_configuration
.
location
);
if
(
_configuration
.
admin
)
free
(
_configuration
.
admin
);
if
(
_configuration
.
source_password
)
free
(
_configuration
.
source_password
);
...
...
@@ -58,8 +59,16 @@ void config_shutdown(void)
if
(
_configuration
.
log_dir
)
free
(
_configuration
.
log_dir
);
if
(
_configuration
.
access_log
)
free
(
_configuration
.
access_log
);
if
(
_configuration
.
error_log
)
free
(
_configuration
.
error_log
);
memset
(
&
_configuration
,
0
,
sizeof
(
ice_config_t
));
if
(
_configuration
.
bind_address
)
free
(
_configuration
.
bind_address
);
dirnode
=
_configuration
.
dir_list
;
while
(
dirnode
)
{
nextdirnode
=
dirnode
->
next
;
free
(
dirnode
->
host
);
free
(
dirnode
);
dirnode
=
nextdirnode
;
}
memset
(
&
_configuration
,
0
,
sizeof
(
ice_config_t
));
}
int
config_parse_file
(
const
char
*
filename
)
...
...
src/connection.c
View file @
59b605ec
...
...
@@ -386,12 +386,16 @@ static void *_handle_connection(void *arg)
format_type_t
format
=
format_get_type
(
contenttype
);
if
(
format
<
0
)
{
WARN1
(
"Content-type
\"
%s
\"
not supported, dropping source"
,
contenttype
);
connection_close
(
con
);
httpp_destroy
(
parser
);
continue
;
}
else
{
source
=
source_create
(
con
,
parser
,
httpp_getvar
(
parser
,
HTTPP_VAR_URI
),
format
);
}
}
else
{
WARN0
(
"No content-type header, cannot handle source"
);
connection_close
(
con
);
httpp_destroy
(
parser
);
continue
;
}
...
...
@@ -400,7 +404,6 @@ static void *_handle_connection(void *arg)
sock_set_blocking
(
con
->
sock
,
SOCK_NONBLOCK
);
thread_create
(
"Source Thread"
,
source_main
,
(
void
*
)
source
,
THREAD_DETACHED
);
continue
;
}
else
if
(
parser
->
req_type
==
httpp_req_stats
)
{
printf
(
"DEBUG: stats connection...
\n
"
);
...
...
src/format_vorbis.c
View file @
59b605ec
...
...
@@ -117,6 +117,10 @@ int format_vorbis_get_buffer(format_plugin_t *self, char *data, unsigned long le
state
->
headbuf
[
i
]
=
NULL
;
}
}
/* Clear old stuff. Rarely but occasionally needed. */
ogg_stream_clear
(
&
state
->
os
);
vorbis_comment_clear
(
&
state
->
vc
);
vorbis_info_clear
(
&
state
->
vi
);
state
->
serialno
=
ogg_page_serialno
(
&
state
->
og
);
ogg_stream_init
(
&
state
->
os
,
state
->
serialno
);
...
...
src/httpp/httpp.c
View file @
59b605ec
...
...
@@ -268,7 +268,7 @@ char *httpp_getvar(http_parser_t *parser, char *name)
return
NULL
;
}
void
httpp_
destroy
(
http_parser_t
*
parser
)
void
httpp_
clear
(
http_parser_t
*
parser
)
{
parser
->
req_type
=
httpp_req_none
;
if
(
parser
->
uri
)
...
...
@@ -278,6 +278,12 @@ void httpp_destroy(http_parser_t *parser)
parser
->
vars
=
NULL
;
}
void
httpp_destroy
(
http_parser_t
*
parser
)
{
httpp_clear
(
parser
);
free
(
parser
);
}
char
*
_lowercase
(
char
*
str
)
{
long
i
;
...
...
src/httpp/httpp.h
View file @
59b605ec
...
...
@@ -40,6 +40,7 @@ int httpp_parse(http_parser_t *parser, char *http_data, unsigned long len);
void
httpp_setvar
(
http_parser_t
*
parser
,
char
*
name
,
char
*
value
);
char
*
httpp_getvar
(
http_parser_t
*
parser
,
char
*
name
);
void
httpp_destroy
(
http_parser_t
*
parser
);
void
httpp_clear
(
http_parser_t
*
parser
);
#endif
...
...
src/stats.c
View file @
59b605ec
...
...
@@ -814,6 +814,7 @@ static int _free_source_stats(void *key)
stats_source_t
*
node
=
(
stats_source_t
*
)
key
;
avl_tree_free
(
node
->
stats_tree
,
_free_stats
);
free
(
node
->
source
);
free
(
node
);
return
1
;
}
...
...
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