summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/dict.c2
-rw-r--r--rpc/rpc-lib/src/rpc-transport.c17
2 files changed, 8 insertions, 11 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index 25ddff0d8c4..6f7adb51589 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -258,8 +258,6 @@ data_copy (data_t *old)
return newdata;
err_out:
-
- FREE (newdata->data);
mem_put (newdata);
return NULL;
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
index e224dcc022e..1216b9fb3df 100644
--- a/rpc/rpc-lib/src/rpc-transport.c
+++ b/rpc/rpc-lib/src/rpc-transport.c
@@ -617,8 +617,10 @@ rpc_transport_unix_options_build (dict_t **options, char *filepath,
}
ret = dict_set_dynstr (dict, "transport.socket.connect-path", fpath);
- if (ret)
+ if (ret) {
+ GF_FREE (fpath);
goto out;
+ }
ret = dict_set_str (dict, "transport.address-family", "unix");
if (ret)
@@ -644,10 +646,8 @@ rpc_transport_unix_options_build (dict_t **options, char *filepath,
*options = dict;
out:
- if (ret) {
- GF_FREE (fpath);
- if (dict)
- dict_unref (dict);
+ if (ret && dict) {
+ dict_unref (dict);
}
return ret;
}
@@ -676,6 +676,7 @@ rpc_transport_inet_options_build (dict_t **options, const char *hostname,
ret = dict_set_dynstr (dict, "remote-host", host);
if (ret) {
+ GF_FREE (host);
gf_log (THIS->name, GF_LOG_WARNING,
"failed to set remote-host with %s", host);
goto out;
@@ -697,10 +698,8 @@ rpc_transport_inet_options_build (dict_t **options, const char *hostname,
*options = dict;
out:
- if (ret) {
- GF_FREE (host);
- if (dict)
- dict_unref (dict);
+ if (ret && dict) {
+ dict_unref (dict);
}
return ret;