summaryrefslogtreecommitdiffstats
path: root/sys/rpc
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2012-10-02 19:10:19 +0000
committerpfg <pfg@FreeBSD.org>2012-10-02 19:10:19 +0000
commit4143500b7bd8c48ee7602a796783fc0a455a6d40 (patch)
tree88d613c3ebda8ac3e23345be862e763e7943f08e /sys/rpc
parent7842c9016d1bb554ec3ceff6a37e072c5556531e (diff)
downloadFreeBSD-src-4143500b7bd8c48ee7602a796783fc0a455a6d40.zip
FreeBSD-src-4143500b7bd8c48ee7602a796783fc0a455a6d40.tar.gz
libtirpc: be sure to free cl_netid and cl_tp
When creating a client with clnt_tli_create, it uses strdup to copy strings for these fields if nconf is passed in. clnt_dg_destroy frees these strings already. Make sure clnt_vc_destroy frees them in the same way. This change matches the reference (OpenSolaris) implementation. Tested by: David Wolfskill Obtained from: Bull GNU/Linux NFSv4 Project (libtirpc) MFC after: 2 weeks
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/clnt_vc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c
index ea3b7d1..26f23fa 100644
--- a/sys/rpc/clnt_vc.c
+++ b/sys/rpc/clnt_vc.c
@@ -836,6 +836,10 @@ clnt_vc_destroy(CLIENT *cl)
soclose(so);
}
mem_free(ct, sizeof(struct ct_data));
+ if (cl->cl_netid && cl->cl_netid[0])
+ mem_free(cl->cl_netid, strlen(cl->cl_netid) +1);
+ if (cl->cl_tp && cl->cl_tp[0])
+ mem_free(cl->cl_tp, strlen(cl->cl_tp) +1);
mem_free(cl, sizeof(CLIENT));
}
OpenPOWER on IntegriCloud