Nullcheck *before* dereferencing.

Also bracketing, replacing a lost comment, and some variable naming.
This commit is contained in:
Alex Young
2012-10-08 14:54:10 +01:00
parent a49cf14927
commit cf62b10adf
2 changed files with 17 additions and 11 deletions

View File

@@ -412,6 +412,8 @@ void client_reply_to_write( struct client* client, struct nbd_request request )
}
else {
debug("No allocation map, writing directly.");
/* If we get cut off partway through reading this data:
* */
ERROR_IF_NEGATIVE(
readloop( client->socket,
client->mapped + request.from,