mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 14:44:28 +00:00
fix for bug #8083 crash caused by double free on m->msg
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@46838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
6
logger.c
6
logger.c
@@ -875,15 +875,19 @@ void ast_verbose(const char *fmt, ...)
|
|||||||
if (complete) {
|
if (complete) {
|
||||||
if (msgcnt < MAX_MSG_QUEUE) {
|
if (msgcnt < MAX_MSG_QUEUE) {
|
||||||
/* Allocate new structure */
|
/* Allocate new structure */
|
||||||
if ((m = malloc(sizeof(*m))))
|
if ((m = malloc(sizeof(*m)))) {
|
||||||
|
m->msg = NULL;
|
||||||
msgcnt++;
|
msgcnt++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Recycle the oldest entry */
|
/* Recycle the oldest entry */
|
||||||
m = list;
|
m = list;
|
||||||
list = list->next;
|
list = list->next;
|
||||||
|
if (m->msg)
|
||||||
free(m->msg);
|
free(m->msg);
|
||||||
}
|
}
|
||||||
if (m) {
|
if (m) {
|
||||||
|
m->msg = NULL;
|
||||||
m->msg = strdup(stuff);
|
m->msg = strdup(stuff);
|
||||||
if (m->msg) {
|
if (m->msg) {
|
||||||
if (last)
|
if (last)
|
||||||
|
Reference in New Issue
Block a user