|
|
e3ffab |
From 57ce6c99123854da69ce07fb8305d102b8e9d271 Mon Sep 17 00:00:00 2001
|
|
|
e3ffab |
From: Jan Cholasta <jcholast@redhat.com>
|
|
|
e3ffab |
Date: Wed, 5 Nov 2014 08:46:19 +0000
|
|
|
e3ffab |
Subject: [PATCH] Fix memory leaks in ipa-extdom-extop
|
|
|
e3ffab |
|
|
|
e3ffab |
https://fedorahosted.org/freeipa/ticket/4651
|
|
|
e3ffab |
|
|
|
e3ffab |
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
|
|
|
e3ffab |
---
|
|
|
e3ffab |
.../ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c | 12 +++++++-----
|
|
|
e3ffab |
1 file changed, 7 insertions(+), 5 deletions(-)
|
|
|
e3ffab |
|
|
|
e3ffab |
diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c
|
|
|
e3ffab |
index df04347e3d36b33ca0a4ea2391f60d97b75a97bf..20fdd62b20f28f5384cf83b8be5819f721c6c3db 100644
|
|
|
e3ffab |
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c
|
|
|
e3ffab |
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c
|
|
|
e3ffab |
@@ -340,7 +340,8 @@ static int pack_ber_user(enum response_types response_type,
|
|
|
e3ffab |
|
|
|
e3ffab |
ber = ber_alloc_t( LBER_USE_DER );
|
|
|
e3ffab |
if (ber == NULL) {
|
|
|
e3ffab |
- return LDAP_OPERATIONS_ERROR;
|
|
|
e3ffab |
+ ret = LDAP_OPERATIONS_ERROR;
|
|
|
e3ffab |
+ goto done;
|
|
|
e3ffab |
}
|
|
|
e3ffab |
|
|
|
e3ffab |
ret = ber_printf(ber,"{e{ssii", response_type, domain_name, short_user_name,
|
|
|
e3ffab |
@@ -449,14 +450,15 @@ static int pack_ber_group(enum response_types response_type,
|
|
|
e3ffab |
|
|
|
e3ffab |
ber = ber_alloc_t( LBER_USE_DER );
|
|
|
e3ffab |
if (ber == NULL) {
|
|
|
e3ffab |
- return LDAP_OPERATIONS_ERROR;
|
|
|
e3ffab |
+ ret = LDAP_OPERATIONS_ERROR;
|
|
|
e3ffab |
+ goto done;
|
|
|
e3ffab |
}
|
|
|
e3ffab |
|
|
|
e3ffab |
ret = ber_printf(ber,"{e{ssi", response_type, domain_name, short_group_name,
|
|
|
e3ffab |
gid);
|
|
|
e3ffab |
if (ret == -1) {
|
|
|
e3ffab |
- ber_free(ber, 1);
|
|
|
e3ffab |
- return LDAP_OPERATIONS_ERROR;
|
|
|
e3ffab |
+ ret = LDAP_OPERATIONS_ERROR;
|
|
|
e3ffab |
+ goto done;
|
|
|
e3ffab |
}
|
|
|
e3ffab |
|
|
|
e3ffab |
if (response_type == RESP_GROUP_MEMBERS) {
|
|
|
e3ffab |
@@ -716,7 +718,7 @@ static int handle_sid_request(enum request_types request_type, const char *sid,
|
|
|
e3ffab |
|
|
|
e3ffab |
ret = get_buffer(&buf_len, &buf;;
|
|
|
e3ffab |
if (ret != LDAP_SUCCESS) {
|
|
|
e3ffab |
- return ret;
|
|
|
e3ffab |
+ goto done;
|
|
|
e3ffab |
}
|
|
|
e3ffab |
|
|
|
e3ffab |
switch(id_type) {
|
|
|
e3ffab |
--
|
|
|
e3ffab |
2.1.0
|
|
|
e3ffab |
|