diff options
author | mogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-01 21:20:35 +0000 |
---|---|---|
committer | mogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-01 21:20:35 +0000 |
commit | 7179ba105f7b84b12710716121ed89ec39f16ca9 (patch) | |
tree | df3f594d79cf7231df71f0548eb89089b52b30b4 /logger.c | |
parent | 98888a61d83443c09f1377ac2c1d163eb75d1e3e (diff) |
fix for bug #8083 crash caused by double free on m->msg
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@46838 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'logger.c')
-rw-r--r-- | logger.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) |