*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getcwd.c,v 1.2 1996/08/19 08:23:15 tholo Exp $";
+static char rcsid[] = "$OpenBSD: getcwd.c,v 1.3 1996/11/27 22:00:45 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
size_t size;
{
register struct dirent *dp;
- register DIR *dir;
+ register DIR *dir = NULL;
register dev_t dev;
register ino_t ino;
register int first;
if (ptsize)
free(pt);
free(up);
+ if (dir)
+ (void)closedir(dir);
return (NULL);
}