plug leak: don't alloc stream when it won't be used

This commit is contained in:
Eric House 2012-09-05 19:09:01 -07:00
parent 71c1fc527a
commit 1ec03e48bb

View file

@ -1391,7 +1391,6 @@ server_sendInitialMessage( ServerCtxt* server )
static void
freeBWI( MPFORMAL BadWordInfo* bwi )
{
/* BadWordInfo* bwi = &server->illegalWordInfo; */
XP_U16 nWords = bwi->nWords;
while ( nWords-- ) {
@ -1871,7 +1870,7 @@ storeBadWords( const XP_UCHAR* word, XP_Bool isLegal,
if ( !isLegal ) {
ServerCtxt* server = (ServerCtxt*)closure;
XP_STATUSF( "storeBadWords called with \"%s\"", word );
XP_LOGF( "storeBadWords called with \"%s\"", word );
server->illegalWordInfo.words[server->illegalWordInfo.nWords++]
= copyString( server->mpool, word );
@ -2102,7 +2101,9 @@ reflectMoveAndInform( ServerCtxt* server, XWStreamCtxt* stream )
(TrayTileSet*)NULL, sourceClientIndex );
server->vol.showPrevMove = XP_TRUE;
mvStream = makeMoveReportIf( server, &wordsStream );
if ( isLegalMove ) {
mvStream = makeMoveReportIf( server, &wordsStream );
}
success = model_commitTurn( model, whoMoved, &newTiles );
resetEngines( server );