From 77459d46b1b242e5a8a3f4beecfb922ee7df80b0 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 26 Aug 2010 05:57:25 +0000 Subject: rpcsvc: fix double free happening when listener creation fails. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 513 (Introduce 0 copy rdma) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=513 --- rpc/rpc-lib/src/rpcsvc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rpc/rpc-lib/src/rpcsvc.c') diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index 01b441317..9ef0f352e 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; -- cgit