From 20cf9c7bff72c5c0ac1ec7c99dadb7e095875bc6 Mon Sep 17 00:00:00 2001 From: Sean Hefty <sean.hefty@intel.com> Date: Tue, 27 Sep 2011 11:19:36 -0700 Subject: [PATCH 2/9] librdmacm: Fix duplicate free of connect The connect data stored with the cma_id_private is freed in rdma_connect, since it is no longer needed. Avoid duplicating the free in rdma_destroy_id by checking for connect_len = 0, rather than connect to be NULL. Signed-off-by: Sean Hefty <sean.hefty@intel.com> --- src/cma.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cma.c b/src/cma.c index 91e110e..e09ab99 100755 --- a/src/cma.c +++ b/src/cma.c @@ -379,7 +379,7 @@ static void ucma_free_id(struct cma_id_private *id_priv) if (id_priv->sync) rdma_destroy_event_channel(id_priv->id.channel); - if (id_priv->connect) + if (id_priv->connect_len) free(id_priv->connect); free(id_priv); } @@ -1319,7 +1319,7 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param) if (ret != sizeof cmd) return (ret >= 0) ? ERR(ENODATA) : -1; - if (id_priv->connect) { + if (id_priv->connect_len) { free(id_priv->connect); id_priv->connect_len = 0; } -- 1.7.6.4