Browse Source

Plug memory leak in pw_copy(); millert@ ok

OPENBSD_3_0
aaron 23 years ago
parent
commit
426796c9a3
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/lib/libutil/passwd.c

+ 3
- 2
src/lib/libutil/passwd.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: passwd.c,v 1.25 2001/07/09 07:04:40 deraadt Exp $ */
/* $OpenBSD: passwd.c,v 1.26 2001/07/11 16:11:10 aaron Exp $ */
/* /*
* Copyright (c) 1987, 1993, 1994, 1995 * Copyright (c) 1987, 1993, 1994, 1995
@ -34,7 +34,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] = "$OpenBSD: passwd.c,v 1.25 2001/07/09 07:04:40 deraadt Exp $";
static char rcsid[] = "$OpenBSD: passwd.c,v 1.26 2001/07/11 16:11:10 aaron Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -485,6 +485,7 @@ pw_copy(ffd, tfd, pw)
if (ferror(to)) if (ferror(to))
err: err:
pw_error(NULL, 0, 1); pw_error(NULL, 0, 1);
free(master);
(void)fclose(to); (void)fclose(to);
} }


Loading…
Cancel
Save