[asterisk-commits] russell: trunk r209887 - in /trunk: ./ main/db1-ast/mpool/mpool.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Aug 1 06:29:30 CDT 2009
Author: russell
Date: Sat Aug 1 06:29:25 2009
New Revision: 209887
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=209887
Log:
Merged revisions 209879 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r209879 | russell | 2009-08-01 06:27:25 -0500 (Sat, 01 Aug 2009) | 5 lines
Resolve a valgrind warning about a read from uninitialized memory.
(issue #15396)
Reported by: aragon
........
Modified:
trunk/ (props changed)
trunk/main/db1-ast/mpool/mpool.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/main/db1-ast/mpool/mpool.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/db1-ast/mpool/mpool.c?view=diff&rev=209887&r1=209886&r2=209887
==============================================================================
--- trunk/main/db1-ast/mpool/mpool.c (original)
+++ trunk/main/db1-ast/mpool/mpool.c Sat Aug 1 06:29:25 2009
@@ -31,6 +31,8 @@
* SUCH DAMAGE.
*/
+#include "asterisk.h"
+
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94";
#endif /* LIBC_SCCS and not lint */
@@ -46,6 +48,8 @@
#include <unistd.h>
#include "../include/db.h"
+
+#include "asterisk/utils.h"
#define __MPOOLINTERFACE_PRIVATE
#include <mpool.h>
@@ -380,7 +384,7 @@
return (bp);
}
-new: if ((bp = (BKT *)malloc(sizeof(BKT) + mp->pagesize)) == NULL)
+new: if ((bp = (BKT *) ast_calloc(1, sizeof(BKT) + mp->pagesize)) == NULL)
return (NULL);
#ifdef STATISTICS
++mp->pagealloc;
More information about the asterisk-commits
mailing list