代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openldap 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 78618653c23168b0cc143eca54264191fa5a8bd6 Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Tue, 5 Jul 2022 03:49:34 +0100
Subject: [PATCH] ITS#9876 Coverity fixes: plug memleaks
---
libraries/libldap/deref.c | 1 +
libraries/libldap/ldif.c | 3 ++-
libraries/libldap/turn.c | 12 ++++++------
libraries/libldap/txn.c | 12 ++++++------
4 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/libraries/libldap/deref.c b/libraries/libldap/deref.c
index 801954eb9..7d3471ad3 100644
--- a/libraries/libldap/deref.c
+++ b/libraries/libldap/deref.c
@@ -193,6 +193,7 @@ ldap_parse_derefresponse_control(
dr = LDAP_CALLOC( 1, sizeof(LDAPDerefRes) );
if ( dr == NULL ) {
ldap_derefresponse_free( drhead );
+ ber_free( ber, 1 );
*drp2 = NULL;
ld->ld_errno = LDAP_NO_MEMORY;
return ld->ld_errno;
diff --git a/libraries/libldap/ldif.c b/libraries/libldap/ldif.c
index 900a97960..57e44f8c7 100644
--- a/libraries/libldap/ldif.c
+++ b/libraries/libldap/ldif.c
@@ -729,7 +729,8 @@ ldif_open(
if ( fp ) {
lfp = ber_memalloc( sizeof( LDIFFP ));
if ( lfp == NULL ) {
- return NULL;
+ fclose( fp );
+ return NULL;
}
lfp->fp = fp;
lfp->prev = NULL;
diff --git a/libraries/libldap/turn.c b/libraries/libldap/turn.c
index 565b449af..7725f01d0 100644
--- a/libraries/libldap/turn.c
+++ b/libraries/libldap/turn.c
@@ -44,7 +44,7 @@ ldap_turn(
{
#ifdef LDAP_EXOP_X_TURN
BerElement *turnvalber = NULL;
- struct berval *turnvalp = NULL;
+ struct berval turnval;
int rc;
turnvalber = ber_alloc_t( LBER_USE_DER );
@@ -53,10 +53,10 @@ ldap_turn(
} else {
ber_printf( turnvalber, "{s}", identifier );
}
- ber_flatten( turnvalber, &turnvalp );
+ ber_flatten2( turnvalber, &turnval, 0 );
rc = ldap_extended_operation( ld, LDAP_EXOP_X_TURN,
- turnvalp, sctrls, cctrls, msgidp );
+ &turnval, sctrls, cctrls, msgidp );
ber_free( turnvalber, 1 );
return rc;
#else
@@ -74,7 +74,7 @@ ldap_turn_s(
{
#ifdef LDAP_EXOP_X_TURN
BerElement *turnvalber = NULL;
- struct berval *turnvalp = NULL;
+ struct berval turnval;
int rc;
turnvalber = ber_alloc_t( LBER_USE_DER );
@@ -83,10 +83,10 @@ ldap_turn_s(
} else {
ber_printf( turnvalber, "{s}", identifier );
}
- ber_flatten( turnvalber, &turnvalp );
+ ber_flatten2( turnvalber, &turnval, 0 );
rc = ldap_extended_operation_s( ld, LDAP_EXOP_X_TURN,
- turnvalp, sctrls, cctrls, NULL, NULL );
+ &turnval, sctrls, cctrls, NULL, NULL );
ber_free( turnvalber, 1 );
return rc;
#else
diff --git a/libraries/libldap/txn.c b/libraries/libldap/txn.c
index 66b22e873..640900234 100644
--- a/libraries/libldap/txn.c
+++ b/libraries/libldap/txn.c
@@ -68,7 +68,7 @@ ldap_txn_end(
{
int rc;
BerElement *txnber = NULL;
- struct berval *txnval = NULL;
+ struct berval txnval;
assert( txnid != NULL );
@@ -80,10 +80,10 @@ ldap_txn_end(
ber_printf( txnber, "{bON}", commit, txnid );
}
- ber_flatten( txnber, &txnval );
+ ber_flatten2( txnber, &txnval, 0 );
rc = ldap_extended_operation( ld, LDAP_EXOP_TXN_END,
- txnval, sctrls, cctrls, msgidp );
+ &txnval, sctrls, cctrls, msgidp );
ber_free( txnber, 1 );
return rc;
@@ -100,7 +100,7 @@ ldap_txn_end_s(
{
int rc;
BerElement *txnber = NULL;
- struct berval *txnval = NULL;
+ struct berval txnval;
struct berval *retdata = NULL;
if ( retidp != NULL ) *retidp = -1;
@@ -113,10 +113,10 @@ ldap_txn_end_s(
ber_printf( txnber, "{bON}", commit, txnid );
}
- ber_flatten( txnber, &txnval );
+ ber_flatten2( txnber, &txnval, 0 );
rc = ldap_extended_operation_s( ld, LDAP_EXOP_TXN_END,
- txnval, sctrls, cctrls, NULL, &retdata );
+ &txnval, sctrls, cctrls, NULL, &retdata );
ber_free( txnber, 1 );
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。