summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2015-10-06 14:02:25 +0000
committerstsp <stsp@openbsd.org>2015-10-06 14:02:25 +0000
commitf011c38568207ebfd26e948f629e794f763aca44 (patch)
treec25bbe42e30e72ebcbba0ec9ac5043b50090a533
parentonly modifies data, stdin to stdout, so tame "stdout" (diff)
downloadwireguard-openbsd-f011c38568207ebfd26e948f629e794f763aca44.tar.xz
wireguard-openbsd-f011c38568207ebfd26e948f629e794f763aca44.zip
Fix buf leak in error path. ok gilles@ eric@
-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);
}