From 966719573b0e64cae31b04c93937315adcd67281 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sat, 20 Sep 2003 00:39:39 +0000 Subject: do not leak if mem_alloc fails --- lib/libc/rpc/auth_unix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/libc/rpc/auth_unix.c') diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c index 7b55938d379..b63894f9473 100644 --- a/lib/libc/rpc/auth_unix.c +++ b/lib/libc/rpc/auth_unix.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: auth_unix.c,v 1.15 2002/01/02 23:00:10 deraadt Exp $"; +static char *rcsid = "$OpenBSD: auth_unix.c,v 1.16 2003/09/20 00:39:39 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -152,6 +152,9 @@ authunix_create(machname, uid, gid, len, aup_gids) #else if ((au->au_origcred.oa_base = mem_alloc((u_int) len)) == NULL) { (void)fprintf(stderr, "authunix_create: out of memory\n"); + XDR_DESTROY(&xdrs); + free(au); + free(auth); return (NULL); } #endif -- cgit v1.2.3-59-g8ed1b