Fix misc. issues reported by Coverity.

Some uninitialized values, a possible null pointer dereference, and
time-of-check-time-of-use on reading random seed file.
This commit is contained in:
Jon Siwek 2013-10-14 14:02:39 -05:00
parent 50784c64bc
commit 38ae7c98b4
10 changed files with 22 additions and 12 deletions

View file

@ -1518,7 +1518,6 @@ int Manager::PutTable(Stream* i, const Value* const *vals)
EnumVal* ev;
int startpos = 0;
Val* predidx = ValueToRecordVal(vals, stream->itype, &startpos);
Ref(valval);
if ( updated )
ev = new EnumVal(BifEnum::Input::EVENT_CHANGED,
@ -1529,7 +1528,10 @@ int Manager::PutTable(Stream* i, const Value* const *vals)
bool result;
if ( stream->num_val_fields > 0 ) // we have values
{
Ref(valval);
result = CallPred(stream->pred, 3, ev, predidx, valval);
}
else // no values
result = CallPred(stream->pred, 2, ev, predidx);