coverity#984097 Uninitialized pointer field
Change-Id: I3098e446f0a2a4cd82785d7dcaf101575ed0b476
This commit is contained in:
@@ -62,24 +62,25 @@ oneToOneMappingWithFlag::oneToOneMappingWithFlag( UnicodePairWithFlag *rpTableWF
|
|||||||
mnFlag ( rnFlag ),
|
mnFlag ( rnFlag ),
|
||||||
mbHasIndex( false )
|
mbHasIndex( false )
|
||||||
{
|
{
|
||||||
|
memset(mpIndex, 0, sizeof(mpIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
oneToOneMappingWithFlag::~oneToOneMappingWithFlag()
|
oneToOneMappingWithFlag::~oneToOneMappingWithFlag()
|
||||||
{
|
{
|
||||||
if( mbHasIndex )
|
if( mbHasIndex )
|
||||||
for( int i = 0; i < 256; i++ )
|
{
|
||||||
if( mpIndex[i] )
|
for (size_t i = 0; i < SAL_N_ELEMENTS(mpIndex); ++i)
|
||||||
delete [] mpIndex[i];
|
delete [] mpIndex[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void oneToOneMappingWithFlag::makeIndex()
|
void oneToOneMappingWithFlag::makeIndex()
|
||||||
{
|
{
|
||||||
if( !mbHasIndex && mpTableWF )
|
if( !mbHasIndex && mpTableWF )
|
||||||
{
|
{
|
||||||
int i, j, current = -1;
|
int current = -1;
|
||||||
|
|
||||||
for( i = 0; i < 256; i++ )
|
for (size_t i = 0; i < SAL_N_ELEMENTS(mpIndex); ++i)
|
||||||
mpIndex[i] = NULL;
|
mpIndex[i] = NULL;
|
||||||
|
|
||||||
for( size_t k = 0; k < mnSize; k++ )
|
for( size_t k = 0; k < mnSize; k++ )
|
||||||
@@ -91,7 +92,7 @@ void oneToOneMappingWithFlag::makeIndex()
|
|||||||
current = high;
|
current = high;
|
||||||
mpIndex[high] = new UnicodePairWithFlag*[256];
|
mpIndex[high] = new UnicodePairWithFlag*[256];
|
||||||
|
|
||||||
for( j = 0; j < 256; j++ )
|
for (int j = 0; j < 256; ++j)
|
||||||
mpIndex[high][j] = NULL;
|
mpIndex[high][j] = NULL;
|
||||||
}
|
}
|
||||||
mpIndex[high][low] = &mpTableWF[k];
|
mpIndex[high][low] = &mpTableWF[k];
|
||||||
|
Reference in New Issue
Block a user