Merge "logging,cdr,cel: Fix stringfield memory leak."

changes/44/2844/3
Joshua Colp 10 years ago committed by Gerrit Code Review
commit e863bca856

@ -81,8 +81,10 @@ static AST_RWLIST_HEAD_STATIC(sinks, cdr_custom_config);
static void free_config(void) static void free_config(void)
{ {
struct cdr_custom_config *sink; struct cdr_custom_config *sink;
while ((sink = AST_RWLIST_REMOVE_HEAD(&sinks, list))) { while ((sink = AST_RWLIST_REMOVE_HEAD(&sinks, list))) {
ast_mutex_destroy(&sink->lock); ast_mutex_destroy(&sink->lock);
ast_string_field_free_memory(sink);
ast_free(sink); ast_free(sink);
} }
} }

@ -76,8 +76,10 @@ static AST_RWLIST_HEAD_STATIC(sinks, cdr_syslog_config);
static void free_config(void) static void free_config(void)
{ {
struct cdr_syslog_config *sink; struct cdr_syslog_config *sink;
while ((sink = AST_RWLIST_REMOVE_HEAD(&sinks, list))) { while ((sink = AST_RWLIST_REMOVE_HEAD(&sinks, list))) {
ast_mutex_destroy(&sink->lock); ast_mutex_destroy(&sink->lock);
ast_string_field_free_memory(sink);
ast_free(sink); ast_free(sink);
} }
} }

@ -71,8 +71,10 @@ static AST_RWLIST_HEAD_STATIC(sinks, cel_config);
static void free_config(void) static void free_config(void)
{ {
struct cel_config *sink; struct cel_config *sink;
while ((sink = AST_RWLIST_REMOVE_HEAD(&sinks, list))) { while ((sink = AST_RWLIST_REMOVE_HEAD(&sinks, list))) {
ast_mutex_destroy(&sink->lock); ast_mutex_destroy(&sink->lock);
ast_string_field_free_memory(sink);
ast_free(sink); ast_free(sink);
} }
} }

@ -174,6 +174,7 @@ struct logmsg {
static void logmsg_free(struct logmsg *msg) static void logmsg_free(struct logmsg *msg)
{ {
ast_string_field_free_memory(msg);
ast_free(msg); ast_free(msg);
} }

Loading…
Cancel
Save