]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
rsocket: Use malloc instead of calloc
authorHal Rosenstock <hal@mellanox.com>
Wed, 18 Jun 2014 16:55:06 +0000 (09:55 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 18 Jun 2014 16:55:06 +0000 (09:55 -0700)
No need to clear allocated memory as immediately followed by
memcpy which covers the allocated memory.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/rsocket.c

index 3a9ff7d54bf08d10b6439c277677af43dc522f00..9a893ca72a2c20ddd021256b28a3bda2c1ff4d85 100644 (file)
@@ -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;