[asterisk-commits] mogorman: branch 1.2 r46962 - /branches/1.2/logger.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Nov 2 10:12:57 MST 2006


Author: mogorman
Date: Thu Nov  2 11:12:56 2006
New Revision: 46962

URL: http://svn.digium.com/view/asterisk?rev=46962&view=rev
Log:
read then commit.... better fix for bug 8083 as
suggested by my peers

Modified:
    branches/1.2/logger.c

Modified: branches/1.2/logger.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/logger.c?rev=46962&r1=46961&r2=46962&view=diff
==============================================================================
--- branches/1.2/logger.c (original)
+++ branches/1.2/logger.c Thu Nov  2 11:12:56 2006
@@ -875,10 +875,8 @@
 	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 @@
 				free(m->msg);
 		}
 		if (m) {
-			m->msg = NULL;
 			m->msg = strdup(stuff);
 			if (m->msg) {
 				if (last)



More information about the asterisk-commits mailing list