]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge script <automerge@asterisk.org>
Wed, 1 Nov 2006 22:01:12 +0000 (22:01 +0000)
committerAutomerge script <automerge@asterisk.org>
Wed, 1 Nov 2006 22:01:12 +0000 (22:01 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@46844 65c4cc65-6c06-0410-ace0-fbb531ad65f3

logger.c

index 85a75d117c00fe3ca3165a643c7600821d0491d3..fcc0797ad15afa472f3a06c4c043d7aeb28ea572 100644 (file)
--- 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)