aboutsummaryrefslogtreecommitdiffstats
path: root/logger.c
diff options
context:
space:
mode:
authormogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-02 17:12:56 +0000
committermogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-02 17:12:56 +0000
commit9668f3c545f73ff4a4c314a41c7713e1dac111c5 (patch)
tree4f870e06dbabfc2257afa4289966c29f63f308b2 /logger.c
parent647b664e3f6505f775c98ae4ad4b948e63a762f0 (diff)
read then commit.... better fix for bug 8083 as
suggested by my peers git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@46962 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'logger.c')
-rw-r--r--logger.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/logger.c b/logger.c
index fcc0797ad..6bfc5eae1 100644
--- a/logger.c
+++ b/logger.c
@@ -875,10 +875,8 @@ void ast_verbose(const char *fmt, ...)
if (complete) {
if (msgcnt < MAX_MSG_QUEUE) {
/* Allocate new structure */
- if ((m = malloc(sizeof(*m)))) {
- m->msg = NULL;
+ if ((m = calloc(1, sizeof(*m))))
msgcnt++;
- }
} else {
/* Recycle the oldest entry */
m = list;
@@ -887,7 +885,6 @@ void ast_verbose(const char *fmt, ...)
free(m->msg);
}
if (m) {
- m->msg = NULL;
m->msg = strdup(stuff);
if (m->msg) {
if (last)