summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-05-05 15:54:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:16:49 -0500
commit3bff11407e721a4a01b67881862d2a466ec5d103 (patch)
tree21e8ae39a7c43a159f3dfc4fd855964e042a4009 /source3/libads
parentc6fa16f330bbc0cc9f428622ca2c4ad0c75cf56a (diff)
downloadsamba-3bff11407e721a4a01b67881862d2a466ec5d103.tar.gz
samba-3bff11407e721a4a01b67881862d2a466ec5d103.tar.bz2
samba-3bff11407e721a4a01b67881862d2a466ec5d103.zip
r15461: Free LDAP result in ads_get_attrname_by_oid().
Guenther (This used to be commit f4af888282ff39665f186550b9ccbbf7a9128fc2)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 81aa9051d7..a8877b5697 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -2471,6 +2471,7 @@ const char *ads_get_attrname_by_oid(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const
void *res = NULL;
char *expr = NULL;
const char *attrs[] = { "lDAPDisplayName", NULL };
+ char *result;
if (ads == NULL || mem_ctx == NULL || OID == NULL) {
goto failed;
@@ -2492,12 +2493,16 @@ const char *ads_get_attrname_by_oid(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const
goto failed;
}
- return ads_pull_string(ads, mem_ctx, res, "lDAPDisplayName");
+ result = ads_pull_string(ads, mem_ctx, res, "lDAPDisplayName");
+ ads_msgfree(ads, res);
+
+ return result;
failed:
DEBUG(0,("ads_get_attrname_by_oid: failed to retrieve name for oid: %s\n",
OID));
+ ads_msgfree(ads, res);
return NULL;
}