summaryrefslogtreecommitdiff
path: root/usr.sbin/popa3d
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-11 18:11:25 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-11 18:11:25 +0000
commit8888c391f2fe5c6b70f99848ce8e5f9a70ba89f3 (patch)
treee7116a75446e92e6cbc4843c9c29c7c749b07c3a /usr.sbin/popa3d
parenta1b094f72c24f7af79beb13eeaeae840f6ab320b (diff)
fix a few memory leaks, found by parfait; ok jsg
Diffstat (limited to 'usr.sbin/popa3d')
-rw-r--r--usr.sbin/popa3d/standalone.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/popa3d/standalone.c b/usr.sbin/popa3d/standalone.c
index f5f390351ca..e47f3404e19 100644
--- a/usr.sbin/popa3d/standalone.c
+++ b/usr.sbin/popa3d/standalone.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: standalone.c,v 1.12 2008/05/24 02:39:23 brad Exp $ */
+/* $OpenBSD: standalone.c,v 1.13 2009/11/11 18:11:24 deraadt Exp $ */
/*
* Standalone POP server: accepts connections, checks the anti-flood limits,
@@ -174,8 +174,10 @@ int main(void)
}
freeaddrinfo(res0);
- if (i == 0)
+ if (i == 0) {
+ free(pfds);
return log_error("socket");
+ }
n = i;
@@ -184,12 +186,14 @@ int main(void)
switch (fork()) {
case -1:
+ free(pfds);
return log_error("fork");
case 0:
break;
default:
+ free(pfds);
return 0;
}
@@ -209,6 +213,7 @@ int main(void)
if (i < 0) {
if (errno == EINTR || errno == EAGAIN)
continue;
+ free(pfds);
return log_error("poll");
}