1 Star 0 Fork 43

pojunxing/openldap

forked from src-openEuler/openldap 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-ITS-9802-slapd-ldap-meta-async-meta-plug-memleak-in-.patch 2.27 KB
一键复制 编辑 原始数据 按行查看 历史
compile_success 提交于 2022-11-07 12:04 . backport patch
From f0a6465f2369696f02dbf2453a6a50089b1558a5 Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Mon, 21 Mar 2022 12:59:07 +0000
Subject: [PATCH] ITS#9802 slapd-ldap/meta/async-meta: plug memleak in
keepalive config
---
servers/slapd/back-asyncmeta/config.c | 8 +++++---
servers/slapd/back-ldap/config.c | 8 +++++---
servers/slapd/back-meta/config.c | 8 +++++---
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/servers/slapd/back-asyncmeta/config.c b/servers/slapd/back-asyncmeta/config.c
index 69f134b2b..e4cc5eab7 100644
--- a/servers/slapd/back-asyncmeta/config.c
+++ b/servers/slapd/back-asyncmeta/config.c
@@ -2498,9 +2498,11 @@ asyncmeta_back_cf_gen( ConfigArgs *c )
break;
#endif /* SLAPD_META_CLIENT_PR */
- case LDAP_BACK_CFG_KEEPALIVE:
- slap_keepalive_parse( ber_bvstrdup(c->argv[1]),
- &mt->mt_tls.sb_keepalive, 0, 0, 0);
+ case LDAP_BACK_CFG_KEEPALIVE: {
+ struct berval bv;
+ ber_str2bv( c->argv[1], 0, 1, &bv );
+ slap_keepalive_parse( &bv, &mt->mt_tls.sb_keepalive, 0, 0, 0 );
+ }
break;
case LDAP_BACK_CFG_TCP_USER_TIMEOUT:
diff --git a/servers/slapd/back-ldap/config.c b/servers/slapd/back-ldap/config.c
index 07fe8e9f1..fb97e8ea3 100644
--- a/servers/slapd/back-ldap/config.c
+++ b/servers/slapd/back-ldap/config.c
@@ -2051,9 +2051,11 @@ done_url:;
}
break;
- case LDAP_BACK_CFG_KEEPALIVE:
- slap_keepalive_parse( ber_bvstrdup(c->argv[1]),
- &li->li_tls.sb_keepalive, 0, 0, 0);
+ case LDAP_BACK_CFG_KEEPALIVE: {
+ struct berval bv;
+ ber_str2bv( c->argv[1], 0, 1, &bv );
+ slap_keepalive_parse( &bv, &li->li_tls.sb_keepalive, 0, 0, 0 );
+ }
break;
case LDAP_BACK_CFG_TCP_USER_TIMEOUT:
diff --git a/servers/slapd/back-meta/config.c b/servers/slapd/back-meta/config.c
index 0f876e77f..c38dce1cf 100644
--- a/servers/slapd/back-meta/config.c
+++ b/servers/slapd/back-meta/config.c
@@ -2913,9 +2913,11 @@ map_fail:;
break;
#endif /* SLAPD_META_CLIENT_PR */
- case LDAP_BACK_CFG_KEEPALIVE:
- slap_keepalive_parse( ber_bvstrdup(c->argv[1]),
- &mt->mt_tls.sb_keepalive, 0, 0, 0);
+ case LDAP_BACK_CFG_KEEPALIVE: {
+ struct berval bv;
+ ber_str2bv( c->argv[ 1 ], 0, 1, &bv );
+ slap_keepalive_parse( &bv, &mt->mt_tls.sb_keepalive, 0, 0, 0 );
+ }
break;
case LDAP_BACK_CFG_TCP_USER_TIMEOUT:
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chengyechun/openldap.git
git@gitee.com:chengyechun/openldap.git
chengyechun
openldap
openldap
master

搜索帮助