Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Icecast-Server
Commits
d218eedf
Commit
d218eedf
authored
Dec 29, 2002
by
Michael Smith
Browse files
Plug several small memory leak, and one huge one in the xslt output code
svn path=/trunk/icecast/; revision=4174
parent
b8a68601
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/config.c
View file @
d218eedf
...
...
@@ -86,6 +86,8 @@ void config_shutdown(void)
if
(
c
->
error_log
&&
c
->
error_log
!=
CONFIG_DEFAULT_ERROR_LOG
)
xmlFree
(
c
->
error_log
);
if
(
c
->
bind_address
)
xmlFree
(
c
->
bind_address
);
if
(
c
->
master_server
)
xmlFree
(
c
->
master_server
);
if
(
c
->
master_password
)
xmlFree
(
c
->
master_password
);
if
(
c
->
user
)
xmlFree
(
c
->
user
);
if
(
c
->
group
)
xmlFree
(
c
->
group
);
dirnode
=
_configuration
.
dir_list
;
...
...
src/main.c
View file @
d218eedf
...
...
@@ -29,6 +29,8 @@
#include
"xslt.h"
#include
"fserve.h"
#include
<libxml/xmlmemory.h>
#ifdef _WIN32
#define snprintf _snprintf
#endif
...
...
@@ -80,6 +82,8 @@ static void _shutdown_subsystems(void)
sock_shutdown
();
thread_shutdown
();
log_shutdown
();
xmlCleanupParser
();
}
static
int
_parse_config_file
(
int
argc
,
char
**
argv
,
char
*
filename
,
int
size
)
...
...
src/slave.c
View file @
d218eedf
...
...
@@ -102,6 +102,7 @@ static void *_slave_thread(void *arg) {
strcat
(
authheader
,
password
);
data
=
util_base64_encode
(
authheader
);
sock_write
(
mastersock
,
"GET /allstreams.txt HTTP/1.0
\r\n
Authorization: Basic %s
\r\n\r\n
"
,
data
);
free
(
authheader
);
free
(
data
);
while
(
sock_read_line
(
mastersock
,
buf
,
sizeof
(
buf
)))
{
if
(
!
strlen
(
buf
))
...
...
src/stats.c
View file @
d218eedf
...
...
@@ -84,6 +84,7 @@ void stats_initialize()
void
stats_shutdown
()
{
int
n
;
stats_event_t
*
event
,
*
next
;
if
(
!
_stats_running
)
/* We can't shutdown if we're not running. */
return
;
...
...
@@ -110,6 +111,17 @@ void stats_shutdown()
thread_mutex_destroy
(
&
_stats_mutex
);
avl_tree_free
(
_stats
.
source_tree
,
_free_source_stats
);
avl_tree_free
(
_stats
.
global_tree
,
_free_stats
);
event
=
_global_event_queue
;
while
(
event
)
{
if
(
event
->
source
)
free
(
event
->
source
);
if
(
event
->
value
)
free
(
event
->
value
);
next
=
event
->
next
;
free
(
event
);
event
=
next
;
}
}
stats_t
*
stats_get_stats
()
...
...
@@ -746,6 +758,7 @@ void stats_get_xml(xmlDocPtr *doc)
stats_event_t
*
queue
;
xmlNodePtr
node
,
srcnode
;
source_xml_t
*
src_nodes
=
NULL
;
source_xml_t
*
next
;
queue
=
NULL
;
_dump_stats_to_queue
(
&
queue
);
...
...
@@ -767,6 +780,13 @@ void stats_get_xml(xmlDocPtr *doc)
_free_event
(
event
);
event
=
_get_event_from_queue
(
&
queue
);
}
while
(
src_nodes
)
{
next
=
src_nodes
->
next
;
free
(
src_nodes
->
mount
);
free
(
src_nodes
);
src_nodes
=
next
;
}
}
void
stats_sendxml
(
client_t
*
client
)
{
...
...
src/xslt.c
View file @
d218eedf
...
...
@@ -169,8 +169,7 @@ void xslt_transform(xmlDocPtr doc, char *xslfilename, client_t *client)
(
char
*
)
outputBuffer
->
buffer
->
content
))
client
->
con
->
sent_bytes
+=
bytes
;
xmlFree
(
outputBuffer
);
xmlOutputBufferClose
(
outputBuffer
);
xmlFreeDoc
(
res
);
}
Write
Preview
Supports
Markdown
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