From ac402b7b3b4bd71e21ad85d3037a297582f1562a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 1 May 2014 09:29:25 +0100 Subject: coverity#707900 Uninitialized pointer field Change-Id: Id2ea7af01708437074a54b59f16f865338cb504a --- hwpfilter/source/hpara.cxx | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'hwpfilter') diff --git a/hwpfilter/source/hpara.cxx b/hwpfilter/source/hpara.cxx index 009876b10dde..bc17e0c8cc1a 100644 --- a/hwpfilter/source/hpara.cxx +++ b/hwpfilter/source/hpara.cxx @@ -52,24 +52,30 @@ bool LineInfo::Read(HWPFile & hwpf, HWPPara *pPara) return (!hwpf.State()); } - -HWPPara::HWPPara(void) +HWPPara::HWPPara() + : _next(NULL) + , reuse_shape(0) + , nch(0) + , nline(0) + , begin_ypos(0) + , scflag(0) + , contain_cshape(0) + , etcflag(0) + , ctrlflag(0) + , pstyno(0) + , pno(0) + , linfo(NULL) + , cshapep(NULL) + , hhstr(NULL) { - _next = NULL; - linfo = NULL; - cshapep = NULL; - hhstr = NULL; - pno = 0; - + memset(&cshape, 0, sizeof(cshape)); + memset(&pshape, 0, sizeof(pshape)); } - -HWPPara::~HWPPara(void) +HWPPara::~HWPPara() { - if (linfo) - delete[]linfo; - if (cshapep) - delete[]cshapep; + delete[] linfo; + delete[] cshapep; if (hhstr) { // virtual destructor -- cgit