Message ID | 53A1A28E.7000408@dev.mellanox.co.il (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
thanks - applied -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/src/rsocket.c b/src/rsocket.c index 3a9ff7d..a3c5385 100644 --- a/src/rsocket.c +++ b/src/rsocket.c @@ -3473,7 +3473,7 @@ int rsetsockopt(int socket, int level, int optname, ret = 0; break; case RDMA_ROUTE: - if ((rs->optval = calloc(optlen, 1))) { + if ((rs->optval = malloc(optlen))) { memcpy(rs->optval, optval, optlen); rs->optlen = optlen; ret = 0;
No need to clear allocated memory as immediately followed by memcpy which covers the allocated memory. Signed-off-by: Hal Rosenstock <hal@mellanox.com> --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html