summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2015-10-06 14:02:26 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2015-10-06 14:02:26 +0000
commite1b92381336cc8c8c3c8b8b5d51117c0768aca09 (patch)
tree264ea2491145d4eb25acd34ccd9d95a0413a73e8 /usr.sbin/smtpd
parent07b899ac43cbbc6df71f74f72d8639001753c480 (diff)
Fix buf leak in error path. ok gilles@ eric@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/table_ldap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/table_ldap.c b/usr.sbin/smtpd/table_ldap.c
index 0b9b7451e79..5cc48f76b78 100644
--- a/usr.sbin/smtpd/table_ldap.c
+++ b/usr.sbin/smtpd/table_ldap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table_ldap.c,v 1.13 2015/01/20 17:37:54 deraadt Exp $ */
+/* $OpenBSD: table_ldap.c,v 1.14 2015/10/06 14:02:25 stsp Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -189,10 +189,10 @@ ldap_connect(const char *addr)
if ((buf = strdup(addr)) == NULL)
return (NULL);
- /* XXX buf leak */
-
+ /* aldap_parse_url frees buf on success */
if (aldap_parse_url(buf, &lu) != 1) {
log_warnx("warn: table-ldap: ldap_parse_url fail");
+ free(buf);
return (NULL);
}