From f011c38568207ebfd26e948f629e794f763aca44 Mon Sep 17 00:00:00 2001 From: stsp Date: Tue, 6 Oct 2015 14:02:25 +0000 Subject: [PATCH] Fix buf leak in error path. ok gilles@ eric@ --- usr.sbin/smtpd/table_ldap.c | 6 +++--- 1 file 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 @@ -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); } -- 2.20.1