summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2004-03-11 18:14:21 +0000
committerbeck <beck@openbsd.org>2004-03-11 18:14:21 +0000
commitf08b6076fa537a50caf0ecc2ea7bce402a2ac5cb (patch)
treef0c4803d6fd952052c9ee69d5fc5f595822b59fa
parentopen O_RDONLY when listing (diff)
downloadwireguard-openbsd-f08b6076fa537a50caf0ecc2ea7bce402a2ac5cb.tar.xz
wireguard-openbsd-f08b6076fa537a50caf0ecc2ea7bce402a2ac5cb.zip
fix leak, found by Patrick Latifi <pat@eyeo.org>
ok millert@, dhartmei@
-rw-r--r--usr.sbin/spamdb/spamdb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/spamdb/spamdb.c b/usr.sbin/spamdb/spamdb.c
index 96be5dca301..74cdcad2bdb 100644
--- a/usr.sbin/spamdb/spamdb.c
+++ b/usr.sbin/spamdb/spamdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamdb.c,v 1.6 2004/03/11 18:09:43 beck Exp $ */
+/* $OpenBSD: spamdb.c,v 1.7 2004/03/11 18:14:21 beck Exp $ */
/*
* Copyright (c) 2004 Bob Beck. All rights reserved.
@@ -197,6 +197,7 @@ dblist(char *dbname)
to = strchr(from, '\n');
if (to == NULL) {
warnx("No from part in grey key %s", a);
+ free(a);
goto bad;
}
*to = '\0';
@@ -205,6 +206,7 @@ dblist(char *dbname)
a, from, to, gd.first, gd.pass, gd.expire,
gd.bcount, gd.pcount);
}
+ free(a);
}
db->close(db);
db = NULL;