From: Pierangelo Masarati Date: Wed, 4 Apr 2012 13:07:37 +0000 (+0200) Subject: fix uninit'ed parameters to monitor_back_register_entry_attrs() X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ce54dabb1b69c5b310cfc4ff689bc339f3256e22;p=openldap fix uninit'ed parameters to monitor_back_register_entry_attrs() --- diff --git a/servers/slapd/back-bdb/monitor.c b/servers/slapd/back-bdb/monitor.c index 9956cbb1f0..88cb9a7759 100644 --- a/servers/slapd/back-bdb/monitor.c +++ b/servers/slapd/back-bdb/monitor.c @@ -339,7 +339,6 @@ bdb_monitor_db_open( BackendDB *be ) int rc = 0; BackendInfo *mi; monitor_extra_t *mbe; - struct berval dummy = BER_BVC(""); if ( !SLAP_DBMONITORING( be ) ) { return 0; @@ -456,7 +455,7 @@ bdb_monitor_db_open( BackendDB *be ) rc = mbe->register_database( be, &bdb->bi_monitor.bdm_ndn ); if ( rc == 0 ) { rc = mbe->register_entry_attrs( &bdb->bi_monitor.bdm_ndn, a, cb, - &dummy, 0, &dummy ); + NULL, 0, NULL ); } cleanup:; diff --git a/servers/slapd/back-ldap/monitor.c b/servers/slapd/back-ldap/monitor.c index 6623a3af52..54a6a6d7f5 100644 --- a/servers/slapd/back-ldap/monitor.c +++ b/servers/slapd/back-ldap/monitor.c @@ -655,7 +655,7 @@ ldap_back_monitor_conn_init( cb->mc_free = ldap_back_monitor_free; cb->mc_private = (void *)li; - rc = mbe->register_entry_attrs( &ms->mss_ndn, a, cb, NULL, 0, NULL ); + rc = mbe->register_entry_attrs( &ms->mss_ndn, a, cb, NULL, -1, NULL ); attr_free( a->a_next ); attr_free( a ); diff --git a/servers/slapd/back-mdb/monitor.c b/servers/slapd/back-mdb/monitor.c index 949183852e..6c4dc4b831 100644 --- a/servers/slapd/back-mdb/monitor.c +++ b/servers/slapd/back-mdb/monitor.c @@ -286,7 +286,6 @@ mdb_monitor_db_open( BackendDB *be ) int rc = 0; BackendInfo *mi; monitor_extra_t *mbe; - struct berval dummy = BER_BVC(""); if ( !SLAP_DBMONITORING( be ) ) { return 0; @@ -387,7 +386,7 @@ mdb_monitor_db_open( BackendDB *be ) rc = mbe->register_database( be, &mdb->mi_monitor.mdm_ndn ); if ( rc == 0 ) { rc = mbe->register_entry_attrs( &mdb->mi_monitor.mdm_ndn, a, cb, - &dummy, 0, &dummy ); + NULL, -1, NULL ); } cleanup:; diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index 111728b1c5..92e1c0e54c 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -941,6 +941,10 @@ monitor_back_register_entry_attrs( monitor_info_t *mi; struct berval ndn = BER_BVNULL; char *fname = ( a == NULL ? "callback" : "attrs" ); + struct berval empty_bv = BER_BVC(""); + + if ( nbase == NULL ) nbase = &empty_bv; + if ( filter == NULL ) filter = &empty_bv; if ( be_monitor == NULL ) { char buf[ SLAP_TEXT_BUFLEN ]; diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 8052304b94..6971694282 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -5520,7 +5520,6 @@ pcache_monitor_db_open( BackendDB *be ) int rc = 0; BackendInfo *mi; monitor_extra_t *mbe; - struct berval dummy = BER_BVC( "" ); if ( !SLAP_DBMONITORING( be ) ) { return 0; @@ -5580,7 +5579,7 @@ pcache_monitor_db_open( BackendDB *be ) rc = mbe->register_overlay( be, on, &cm->monitor_ndn ); if ( rc == 0 ) { rc = mbe->register_entry_attrs( &cm->monitor_ndn, a, cb, - &dummy, -1, &dummy); + NULL, -1, NULL); } cleanup:;