summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-07-20 05:51:44 +0000
committerderaadt <deraadt@openbsd.org>1996-07-20 05:51:44 +0000
commit6d97e568a729b000ca3379d32194a4b488ea55b4 (patch)
tree256811bb2fcc0489dc0b3d35e43edf06935cfc26 /lib/libc
parentrpc.lockd (diff)
downloadwireguard-openbsd-6d97e568a729b000ca3379d32194a4b488ea55b4.tar.xz
wireguard-openbsd-6d97e568a729b000ca3379d32194a4b488ea55b4.zip
bogus frees; from jraynard@freebsd.org
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/rpc/clnt_tcp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c
index ce6dd3bae18..7919181e53d 100644
--- a/lib/libc/rpc/clnt_tcp.c
+++ b/lib/libc/rpc/clnt_tcp.c
@@ -218,8 +218,10 @@ fooy:
/*
* Something goofed, free stuff and barf
*/
- mem_free((caddr_t)ct, sizeof(struct ct_data));
- mem_free((caddr_t)h, sizeof(CLIENT));
+ if (ct)
+ mem_free((caddr_t)ct, sizeof(struct ct_data));
+ if (h)
+ mem_free((caddr_t)h, sizeof(CLIENT));
return ((CLIENT *)NULL);
}