]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9802 slapd-ldap/meta/async-meta: plug memleak in keepalive config
authorHoward Chu <hyc@openldap.org>
Mon, 21 Mar 2022 12:59:07 +0000 (12:59 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 21 Mar 2022 21:57:37 +0000 (21:57 +0000)
servers/slapd/back-asyncmeta/config.c
servers/slapd/back-ldap/config.c
servers/slapd/back-meta/config.c

index 866fb985d45b5355c37c45213afe02bce606031b..849ac01616dba0b3f713e1d31904d6af61c12503 100644 (file)
@@ -2405,9 +2405,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:
index 07fe8e9f19d4b66f54d355230e73be5d095f2fde..fb97e8ea32ba0fc3675f82a24b3c155f7327ca95 100644 (file)
@@ -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:
index 0f876e77fef6eb44e35a5b4da642a9978e5683ab..c38dce1cfa1e964b5c29428792372adc34ec254f 100644 (file)
@@ -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: