ldap/servers/slapd/back-ldbm/init.c | 2 ++
ldap/servers/slapd/result.c | 10 ++++++++++
2 files changed, 12 insertions(+)
New commits:
commit d91cd6344ca40f92c19856159add2a08d4f78993
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 15:09:35 2011 -0600
Bug 690584 - #10652 #10651 #10650 #10649 #10648 #10647 send_specific_attrs
send_all_attrs - fix coverity resource leak issues
https://bugzilla.redhat.com/show_bug.cgi?id=690584
Resolves: bug 690584
Bug Description: #10652 #10651 #10650 #10649 #10648 #10647 send_specific_attrs
send_all_attrs - fix coverity resource leak issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: if it is possible for slapi_vattr_namespace_values_get_sp with rc !=
0 or
item_count == 0, make sure to free the values allocated
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
index d269477..800fb39 100644
--- a/ldap/servers/slapd/result.c
+++ b/ldap/servers/slapd/result.c
@@ -1045,6 +1045,11 @@ static int send_all_attrs(Slapi_Entry *e,char
**attrs,Slapi_Operation *op,Slapi_
}
} else {
+ /* if we got here, then either values is NULL or values contains no elements
+ either way we can free it */
+ slapi_ch_free((void**)&values);
+ slapi_ch_free((void**)&actual_type_name);
+ slapi_ch_free((void**)&type_name_disposition);
rc = 0;
}
}
@@ -1177,6 +1182,11 @@ int send_specific_attrs(Slapi_Entry *e,char **attrs,Slapi_Operation
*op,Slapi_PB
}
} else {
+ /* if we got here, then either values is NULL or values contains no elements
+ either way we can free it */
+ slapi_ch_free((void**)&values);
+ slapi_ch_free((void**)&actual_type_name);
+ slapi_ch_free((void**)&type_name_disposition);
rc = 0;
}
}
commit 9ea3531355c40b9e9742ca11254e090394db56dd
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 15:01:14 2011 -0600
Bug 690584 - #10691 ldbm_back_init() - fix coverity resource leak issues
https://bugzilla.redhat.com/show_bug.cgi?id=690584
Resolves: bug 690584
Bug Description: #10691 ldbm_back_init() - fix coverity resource leak issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: also have to free li and set the pblock pointer to NULL
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/init.c b/ldap/servers/slapd/back-ldbm/init.c
index 19e6ab6..a904b9c 100644
--- a/ldap/servers/slapd/back-ldbm/init.c
+++ b/ldap/servers/slapd/back-ldbm/init.c
@@ -280,6 +280,8 @@ ldbm_back_init( Slapi_PBlock *pb )
fail:
dblayer_terminate( li );
+ slapi_ch_free((void **)&li);
+ slapi_pblock_set( pb, SLAPI_PLUGIN_PRIVATE, NULL );
return( -1 );
}