diff options
author | Raghavendra G <raghavendra@gluster.com> | 2010-08-26 05:57:25 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-08-26 07:31:17 -0700 |
commit | 77459d46b1b242e5a8a3f4beecfb922ee7df80b0 (patch) | |
tree | 97462c6091a0a1b805c2997679fa7cf27c87e0ab | |
parent | 9fe52c92ace1c8c1e6e016aad8bb14973d6c9dc0 (diff) |
rpcsvc: fix double free happening when listener creation fails.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 513 (Introduce 0 copy rdma)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=513
-rw-r--r-- | rpc/rpc-lib/src/rpcsvc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index 01b441317c3..9ef0f352ec8 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -1679,24 +1679,24 @@ rpcsvc_create_listeners (rpcsvc_t *svc, dict_t *options, char *name) goto out; } - ret = dict_set_dynstr (options, "transport-type", ptr); + ret = asprintf (&transport_name, "%s.%s", ptr, name); if (ret == -1) { goto out; } - ret = asprintf (&transport_name, "%s.%s", ptr, name); + ret = dict_set_dynstr (options, "transport-type", ptr); if (ret == -1) { goto out; } + ptr = strtok_r (NULL, ",", &saveptr); + ret = rpcsvc_create_listener (svc, options, transport_name); if (ret != 0) { goto out; } count++; - - ptr = strtok_r (NULL, ",", &saveptr); } ptr = NULL; |