No need to clear allocated memory as immediately followed by
memcpy which covers the allocated memory.

Signed-off-by: Hal Rosenstock <[email protected]>
---
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to