Loading lib/nvmf/conf.c +6 −8 Original line number Diff line number Diff line Loading @@ -118,14 +118,14 @@ spdk_nvmf_parse_addr(char *listen_addr, char **host, char **port) } p++; n = p - listen_addr; *host = malloc(n + 1); *host = calloc(1, n + 1); if (!*host) { return -1; } memcpy(*host, listen_addr, n); (*host)[n] = '\0'; if (p[0] == '\0') { *port = malloc(PORTNUMSTRLEN); *port = calloc(1, PORTNUMSTRLEN); if (!*port) { free(*host); return -1; Loading @@ -142,12 +142,11 @@ spdk_nvmf_parse_addr(char *listen_addr, char **host, char **port) } len = q - p - 1; *port = malloc(len + 1); *port = calloc(1, len + 1); if (!*port) { free(*host); return -1; } memset(*port, 0, len + 1); memcpy(*port, p + 1, len); } } else { Loading @@ -157,14 +156,14 @@ spdk_nvmf_parse_addr(char *listen_addr, char **host, char **port) p = listen_addr + strlen(listen_addr); } n = p - listen_addr; *host = malloc(n + 1); *host = calloc(1, n + 1); if (!*host) { return -1; } memcpy(*host, listen_addr, n); (*host)[n] = '\0'; if (p[0] == '\0') { *port = malloc(PORTNUMSTRLEN); *port = calloc(1, PORTNUMSTRLEN); if (!*port) { free(*host); return -1; Loading @@ -186,12 +185,11 @@ spdk_nvmf_parse_addr(char *listen_addr, char **host, char **port) } len = q - p - 1; *port = malloc(len + 1); *port = calloc(1, len + 1); if (!*port) { free(*host); return -1; } memset(*port, 0, len + 1); memcpy(*port, p + 1, len); } Loading lib/nvmf/session.c +2 −3 Original line number Diff line number Diff line Loading @@ -53,10 +53,9 @@ nvmf_create_session(const char *subnqn) if (subsystem == NULL) return NULL; session = malloc(sizeof(struct nvmf_session)); session = calloc(1, sizeof(struct nvmf_session)); if (session == NULL) goto exit; memset(session, 0, sizeof(struct nvmf_session)); subsystem->num_sessions++; /* define cntlid that is unique across all subsystems */ Loading Loading @@ -235,7 +234,7 @@ nvmf_connect(void *fabric_conn, struct nvmf_session *session; struct nvmf_connection_entry *connection = NULL; connection = malloc(sizeof(struct nvmf_connection_entry)); connection = calloc(1, sizeof(struct nvmf_connection_entry)); if (connection == NULL) goto connect_fail; Loading Loading
lib/nvmf/conf.c +6 −8 Original line number Diff line number Diff line Loading @@ -118,14 +118,14 @@ spdk_nvmf_parse_addr(char *listen_addr, char **host, char **port) } p++; n = p - listen_addr; *host = malloc(n + 1); *host = calloc(1, n + 1); if (!*host) { return -1; } memcpy(*host, listen_addr, n); (*host)[n] = '\0'; if (p[0] == '\0') { *port = malloc(PORTNUMSTRLEN); *port = calloc(1, PORTNUMSTRLEN); if (!*port) { free(*host); return -1; Loading @@ -142,12 +142,11 @@ spdk_nvmf_parse_addr(char *listen_addr, char **host, char **port) } len = q - p - 1; *port = malloc(len + 1); *port = calloc(1, len + 1); if (!*port) { free(*host); return -1; } memset(*port, 0, len + 1); memcpy(*port, p + 1, len); } } else { Loading @@ -157,14 +156,14 @@ spdk_nvmf_parse_addr(char *listen_addr, char **host, char **port) p = listen_addr + strlen(listen_addr); } n = p - listen_addr; *host = malloc(n + 1); *host = calloc(1, n + 1); if (!*host) { return -1; } memcpy(*host, listen_addr, n); (*host)[n] = '\0'; if (p[0] == '\0') { *port = malloc(PORTNUMSTRLEN); *port = calloc(1, PORTNUMSTRLEN); if (!*port) { free(*host); return -1; Loading @@ -186,12 +185,11 @@ spdk_nvmf_parse_addr(char *listen_addr, char **host, char **port) } len = q - p - 1; *port = malloc(len + 1); *port = calloc(1, len + 1); if (!*port) { free(*host); return -1; } memset(*port, 0, len + 1); memcpy(*port, p + 1, len); } Loading
lib/nvmf/session.c +2 −3 Original line number Diff line number Diff line Loading @@ -53,10 +53,9 @@ nvmf_create_session(const char *subnqn) if (subsystem == NULL) return NULL; session = malloc(sizeof(struct nvmf_session)); session = calloc(1, sizeof(struct nvmf_session)); if (session == NULL) goto exit; memset(session, 0, sizeof(struct nvmf_session)); subsystem->num_sessions++; /* define cntlid that is unique across all subsystems */ Loading Loading @@ -235,7 +234,7 @@ nvmf_connect(void *fabric_conn, struct nvmf_session *session; struct nvmf_connection_entry *connection = NULL; connection = malloc(sizeof(struct nvmf_connection_entry)); connection = calloc(1, sizeof(struct nvmf_connection_entry)); if (connection == NULL) goto connect_fail; Loading