]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-monitor/conn.c
Plug memory leak
[openldap] / servers / slapd / back-monitor / conn.c
index 685df216d4d5c2a6253754665af0ca919aa9e481..5bbaca74e1bcf43960d501240a5b8f414d841416 100644 (file)
@@ -34,6 +34,7 @@
 #include "portable.h"
 
 #include <stdio.h>
+#include "lutil.h"
 
 #include "slap.h"
 #include "back-monitor.h"
@@ -210,12 +211,12 @@ monitor_subsys_conn_update(
        assert( mi );
        assert( e );
        
-       if ( strncasecmp( e->e_ndn, "CN=TOTAL", 
-                               sizeof("CN=TOTAL")-1 ) == 0 ) {
+       if ( strncasecmp( e->e_ndn, "cn=total", 
+                               sizeof("cn=total")-1 ) == 0 ) {
                n = connections_nextid();
 
-       } else if ( strncasecmp( e->e_ndn, "CN=CURRENT", 
-                               sizeof("CN=CURRENT")-1 ) == 0 ) {
+       } else if ( strncasecmp( e->e_ndn, "cn=current", 
+                               sizeof("cn=current")-1 ) == 0 ) {
                Connection      *c;
                int             connindex;
 
@@ -252,9 +253,9 @@ conn_create(
 {
        struct monitorentrypriv *mp;
        struct tm               *ltm;
-       char                    buf[1024];
-       char                    buf2[22];
-       char                    buf3[22];
+       char                    buf[ 1024 ];
+       char                    buf2[ LDAP_LUTIL_GENTIME_BUFSIZE ];
+       char                    buf3[ LDAP_LUTIL_GENTIME_BUFSIZE ];
 
        struct berval           bv[2];
 
@@ -292,10 +293,10 @@ conn_create(
        ldap_pvt_thread_mutex_lock( &gmtime_mutex );
        
        ltm = gmtime( &c->c_starttime );
-       strftime( buf2, sizeof(buf2), "%Y%m%d%H%M%SZ", ltm );
+       lutil_gentime( buf2, sizeof( buf2 ), ltm );
                        
        ltm = gmtime( &c->c_activitytime );
-       strftime( buf3, sizeof(buf2), "%Y%m%d%H%M%SZ", ltm );
+       lutil_gentime( buf3, sizeof( buf3 ), ltm );
                        
        ldap_pvt_thread_mutex_unlock( &gmtime_mutex );