Fix error handling.

MFC after:	1 month
Coverity CID:	1249768
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2014-11-21 16:14:32 +00:00
parent a675fdbf5f
commit 9f4958782a

View File

@ -63,7 +63,7 @@ isns_req_alloc(void)
req->ir_buflen = sizeof(struct isns_hdr);
req->ir_usedlen = 0;
req->ir_buf = calloc(req->ir_buflen, 1);
if (req == NULL) {
if (req->ir_buf == NULL) {
free(req);
log_err(1, "calloc");
return (NULL);