Comments
Patch
@@ -138,8 +138,12 @@ fedfs_get_limited_nsdb_params_call(const char *hostname, const char *nettype,
if (status != RPC_SUCCESS) {
clnt_perror(client, "FEDFS_GET_LIMITED_NSDB_PARAMS call failed");
result.status = FEDFS_ERR_SVRFAULT;
- } else
+ } else {
fedfs_get_limited_nsdb_params_print_result(result);
+ clnt_freeres(client,
+ (xdrproc_t)xdr_FedFsGetLimitedNsdbParamsRes,
+ (caddr_t)&result);
+ }
(void)clnt_destroy(client);
out:
@@ -140,8 +140,12 @@ fedfs_get_nsdb_params_call(const char *hostname, const char *nettype,
if (status != RPC_SUCCESS) {
clnt_perror(client, "FEDFS_GET_NSDB_PARAMS call failed");
result.status = FEDFS_ERR_SVRFAULT;
- } else
+ } else {
fedfs_get_nsdb_params_print_result(result);
+ clnt_freeres(client,
+ (xdrproc_t)xdr_FedFsGetNsdbParamsRes,
+ (caddr_t)&result);
+ }
(void)clnt_destroy(client);
out:
@@ -247,8 +247,12 @@ fedfs_lookup_junction_call(const char *hostname, const char *nettype,
if (status != RPC_SUCCESS) {
clnt_perror(client, "FEDFS_LOOKUP_JUNCTION call failed");
result.status = FEDFS_ERR_SVRFAULT;
- } else
+ } else {
fedfs_lookup_junction_print_result(result);
+ clnt_freeres(client,
+ (xdrproc_t)xdr_FedFsLookupRes,
+ (caddr_t)&result);
+ }
(void)clnt_destroy(client);
out:
@@ -252,8 +252,12 @@ fedfs_lookup_replication_call(const char *hostname, const char *nettype,
if (status != RPC_SUCCESS) {
clnt_perror(client, "FEDFS_LOOKUP_REPLICATION call failed");
result.status = FEDFS_ERR_SVRFAULT;
- } else
+ } else {
fedfs_lookup_replication_print_result(result);
+ clnt_freeres(client,
+ (xdrproc_t)xdr_FedFsLookupRes,
+ (caddr_t)&result);
+ }
(void)clnt_destroy(client);
out:
This is not strictly necessary, since these are one-shot clients that exit quickly. But it does clean up the output of valgrind so it's easier to spot real leaks. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- src/fedfsc/fedfs-get-limited-nsdb-params.c | 6 +++++- src/fedfsc/fedfs-get-nsdb-params.c | 6 +++++- src/fedfsc/fedfs-lookup-junction.c | 6 +++++- src/fedfsc/fedfs-lookup-replication.c | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-)