Correct excessive TCP connection bug
[ric-plt/lib/rmr.git] / src / rmr / common / src / logging.c
index 65fb745..56457f7 100644 (file)
@@ -101,8 +101,8 @@ extern int rmr_vlog_init( ) {
 
        if( (data = getenv( ENV_LOG_VLEVEL )) != NULL ) {
                log_vlevel = atoi( data );
-               if( log_vlevel < 0 ) {
-                       log_vlevel = 0;
+               if( log_vlevel < -1 ) {                                                 // allow housekeeping stats to be squelched with -1
+                       log_vlevel = -1;
                } else {
                        if( log_vlevel > RMR_VL_DEBUG ) {
                                log_vlevel = RMR_VL_DEBUG;
@@ -156,6 +156,8 @@ extern void rmr_vlog( int write_level, char* fmt, ... ) {
 
        vsnprintf( body, sizeof( msg ) - (hlen+2), fmt, argp );                 // add in user message formatting it along the way
        fprintf( stderr, "%s", msg );                                                                   // we grew from printfs so all existing msg have \n; assume there
+
+       va_end( argp );
 }
 
 /*
@@ -190,6 +192,8 @@ extern void rmr_vlog_force( int write_level, char* fmt, ... ) {
 
        vsnprintf( body, sizeof( msg ) - (hlen+2), fmt, argp );                 // add in user message formatting it along the way
        fprintf( stderr, "%s", msg );                                                                   // we grew from printfs so all existing msg have \n; assume there
+
+       va_end( argp );
 }
 
 // -------------------- public functions that are needed -----------------