summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2003-09-20 00:40:36 +0000
committerderaadt <deraadt@openbsd.org>2003-09-20 00:40:36 +0000
commitd69f0da124a88b461373326ac42a464eee581c3b (patch)
tree053f5cff3b58d1521263beb9d9ed2cc80e065c31 /lib
parentdo not leak if mem_alloc fails (diff)
downloadwireguard-openbsd-d69f0da124a88b461373326ac42a464eee581c3b.tar.xz
wireguard-openbsd-d69f0da124a88b461373326ac42a464eee581c3b.zip
incorrect ordering of free operations
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/svc_udp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/rpc/svc_udp.c b/lib/libc/rpc/svc_udp.c
index 3ba6d5d1544..5c5ed600d89 100644
--- a/lib/libc/rpc/svc_udp.c
+++ b/lib/libc/rpc/svc_udp.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc_udp.c,v 1.12 2002/09/06 18:35:12 deraadt Exp $";
+static char *rcsid = "$OpenBSD: svc_udp.c,v 1.13 2003/09/20 00:40:36 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -149,8 +149,8 @@ svcudp_bufcreate(sock, sendsz, recvsz)
free(su);
return (NULL);
}
- xdrmem_create(
- &(su->su_xdrs), rpc_buffer(xprt), su->su_iosz, XDR_DECODE);
+ xdrmem_create(&(su->su_xdrs), rpc_buffer(xprt), su->su_iosz,
+ XDR_DECODE);
su->su_cache = NULL;
xprt->xp_p2 = (caddr_t)su;
xprt->xp_verf.oa_base = su->su_verfbody;
@@ -160,8 +160,8 @@ svcudp_bufcreate(sock, sendsz, recvsz)
if (__xprt_register(xprt) == 0) {
if (madesock)
(void)close(sock);
- free(xprt);
free(rpc_buffer(xprt));
+ free(xprt);
free(su);
return (NULL);
}