From ae395070d9d8b33df080bf83b62ae7ecde8792ae Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Tue, 6 Dec 2011 09:46:48 -0500 Subject: [PATCH] Zero memory to duplicate behavior changed when C malloc() was replaced by C++ new(). --- pcbnew/board.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index b3209eabad..7568b3ba3f 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -115,18 +115,21 @@ int MATRIX_ROUTING_HEAD::InitBoard() /* allocate Board & initialize everything to empty */ m_BoardSide[kk] = (MATRIX_CELL*) operator new( ii * sizeof(MATRIX_CELL) ); + memset( m_BoardSide[kk], 0, ii * sizeof(MATRIX_CELL) ); if( m_BoardSide[kk] == NULL ) return -1; /***** allocate Distances *****/ m_DistSide[kk] = (DIST_CELL*) operator new( ii * sizeof(DIST_CELL) ); + memset( m_DistSide[kk], 0, ii * sizeof(DIST_CELL) ); if( m_DistSide[kk] == NULL ) return -1; /***** allocate Dir (chars) *****/ m_DirSide[kk] = (char*) operator new( ii ); + memset( m_DirSide[kk], 0, ii ); if( m_DirSide[kk] == NULL ) return -1;