aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-01 22:01:12 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-01 22:01:12 +0000
commit6f3ecd75f9cff5f09443d48b7d4e2e658b450540 (patch)
treebca3995616be29ec91d6288aa630ca6eaa4dc479
parent68ccd3fc6b41e94cc233c64241c5be4e2c44c673 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@46844 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--logger.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/logger.c b/logger.c
index 85a75d117..fcc0797ad 100644
--- a/logger.c
+++ b/logger.c
@@ -875,15 +875,19 @@ void ast_verbose(const char *fmt, ...)
if (complete) {
if (msgcnt < MAX_MSG_QUEUE) {
/* Allocate new structure */
- if ((m = malloc(sizeof(*m))))
+ if ((m = malloc(sizeof(*m)))) {
+ m->msg = NULL;
msgcnt++;
+ }
} else {
/* Recycle the oldest entry */
m = list;
list = list->next;
- free(m->msg);
+ if (m->msg)
+ free(m->msg);
}
if (m) {
+ m->msg = NULL;
m->msg = strdup(stuff);
if (m->msg) {
if (last)