isns.c (273635) | isns.c (274939) |
---|---|
1/*- 2 * Copyright (c) 2014 Alexander Motin <mav@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2014 Alexander Motin <mav@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/usr.sbin/ctld/isns.c 273635 2014-10-25 12:50:26Z mav $"); | 29__FBSDID("$FreeBSD: stable/10/usr.sbin/ctld/isns.c 274939 2014-11-24 00:47:04Z mav $"); |
30 31#include <sys/types.h> 32#include <sys/time.h> 33#include <sys/socket.h> 34#include <sys/wait.h> 35#include <sys/endian.h> 36#include <netinet/in.h> 37#include <arpa/inet.h> --- 20 unchanged lines hidden (view full) --- 58 req = calloc(sizeof(struct isns_req), 1); 59 if (req == NULL) { 60 log_err(1, "calloc"); 61 return (NULL); 62 } 63 req->ir_buflen = sizeof(struct isns_hdr); 64 req->ir_usedlen = 0; 65 req->ir_buf = calloc(req->ir_buflen, 1); | 30 31#include <sys/types.h> 32#include <sys/time.h> 33#include <sys/socket.h> 34#include <sys/wait.h> 35#include <sys/endian.h> 36#include <netinet/in.h> 37#include <arpa/inet.h> --- 20 unchanged lines hidden (view full) --- 58 req = calloc(sizeof(struct isns_req), 1); 59 if (req == NULL) { 60 log_err(1, "calloc"); 61 return (NULL); 62 } 63 req->ir_buflen = sizeof(struct isns_hdr); 64 req->ir_usedlen = 0; 65 req->ir_buf = calloc(req->ir_buflen, 1); |
66 if (req == NULL) { | 66 if (req->ir_buf == NULL) { |
67 free(req); 68 log_err(1, "calloc"); 69 return (NULL); 70 } 71 return (req); 72} 73 74struct isns_req * --- 184 unchanged lines hidden --- | 67 free(req); 68 log_err(1, "calloc"); 69 return (NULL); 70 } 71 return (req); 72} 73 74struct isns_req * --- 184 unchanged lines hidden --- |