X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=book.c;h=ba7a9afc07921957a6da6fc4d01dd00d7bac8695;hb=7d91881cdf963ba7deb990d343195395a579182c;hp=124344f551c3dce6f32c7fdbfa370e56928f2067;hpb=570f0d333ffba03730d5bc5a69ef5a509247104f;p=xboard.git diff --git a/book.c b/book.c index 124344f..ba7a9af 100644 --- a/book.c +++ b/book.c @@ -481,7 +481,10 @@ char *ProbeBook(int moveNr, char *book) if(appData.debugMode) fprintf(debugFP, "book key = %08x%08x\n", (unsigned int)(key>>32), (unsigned int)key); offset=find_key(f, key, &entry); - if(entry.key != key) return NULL; + if(entry.key != key) { + fclose(f); + return NULL; + } entries[0] = entry; count=1; fseek(f, 16*(offset+1), SEEK_SET); @@ -500,7 +503,6 @@ char *ProbeBook(int moveNr, char *book) for(i=0; i> 15; // create random < total_weight total_weight = 0; for(i=0; i