diff options
author | pfg <pfg@FreeBSD.org> | 2012-10-02 19:10:19 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2012-10-02 19:10:19 +0000 |
commit | 4143500b7bd8c48ee7602a796783fc0a455a6d40 (patch) | |
tree | 88d613c3ebda8ac3e23345be862e763e7943f08e /lib/libc | |
parent | 7842c9016d1bb554ec3ceff6a37e072c5556531e (diff) | |
download | FreeBSD-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 'lib/libc')
-rw-r--r-- | lib/libc/rpc/clnt_vc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c index 07eff46..881f84d 100644 --- a/lib/libc/rpc/clnt_vc.c +++ b/lib/libc/rpc/clnt_vc.c @@ -672,6 +672,10 @@ clnt_vc_destroy(cl) if (ct->ct_addr.buf) free(ct->ct_addr.buf); 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)); mutex_unlock(&clnt_fd_lock); thr_sigsetmask(SIG_SETMASK, &(mask), NULL); |