summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authoraschrijver <aschrijver@cvs.openbsd.org>2008-12-27 19:46:13 +0000
committeraschrijver <aschrijver@cvs.openbsd.org>2008-12-27 19:46:13 +0000
commit0797d16af007bc4dd2fabe557ba62f7fa83dee93 (patch)
tree79bf7b40ab6c3577bfb1b62dc3ee1b9dc0be53e6 /usr.sbin
parent0e4417443f0cb13a3cdc5b6185a959cb6f26942d (diff)
Fix memory leak.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ypldap/aldap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/ypldap/aldap.c b/usr.sbin/ypldap/aldap.c
index 816b2d5bc36..84bf03af9f1 100644
--- a/usr.sbin/ypldap/aldap.c
+++ b/usr.sbin/ypldap/aldap.c
@@ -1,5 +1,5 @@
-/* $Id: aldap.c,v 1.7 2008/11/28 10:07:56 aschrijver Exp $ */
-/* $OpenBSD: aldap.c,v 1.7 2008/11/28 10:07:56 aschrijver Exp $ */
+/* $Id: aldap.c,v 1.8 2008/12/27 19:46:12 aschrijver Exp $ */
+/* $OpenBSD: aldap.c,v 1.8 2008/12/27 19:46:12 aschrijver Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
@@ -75,6 +75,8 @@ aldap_bind(struct aldap *ldap, char *binddn, char *bindcred)
if(ber_write_elements(&ldap->ber, root) == -1)
return (-1);
+ ber_free_elements(root);
+
return (ldap->msgid);
}
@@ -92,6 +94,8 @@ aldap_unbind(struct aldap *ldap)
if(ber_write_elements(&ldap->ber, root) == -1)
return (-1);
+ ber_free_elements(root);
+
return (ldap->msgid);
}
@@ -119,6 +123,8 @@ aldap_search(struct aldap *ldap, char *basedn, enum scope scope, char *filter,
if(ber_write_elements(&ldap->ber, root) == -1)
return (-1);
+ ber_free_elements(root);
+
return (ldap->msgid);
}