Fix some memleaks
authorVolker Lendecke <vl@samba.org>
Wed, 26 Dec 2007 22:44:24 +0000 (23:44 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 26 Dec 2007 22:45:10 +0000 (23:45 +0100)
(This used to be commit 78b0b66cbac349625257260d2e45d918e0c93617)

source3/lib/debug.c

index 87ec9ed8f577a9f948b404a296aaaea6067953a8..9ea2dc151afd1d3b6c82c499f9e38afd5a399f3c 100644 (file)
@@ -785,13 +785,13 @@ void check_log_size( void )
                        (void)x_vfprintf( dbf, format_str, ap );
                va_end( ap );
                errno = old_errno;
-               return( 0 );
+               goto done;
        }
 
        /* prevent recursion by checking if reopen_logs() has temporaily
           set the debugf string to NULL */
        if( debugf == NULL)
-               return( 0 );
+               goto done;
 
 #ifdef WITH_SYSLOG
        if( !lp_syslog_only() )
@@ -806,7 +806,7 @@ void check_log_size( void )
                                x_setbuf( dbf, NULL );
                        } else {
                                errno = old_errno;
-                               return(0);
+                               goto done;
                        }
                }
        }
@@ -855,10 +855,11 @@ void check_log_size( void )
                        (void)x_fflush( dbf );
        }
 
-       errno = old_errno;
-
+ done:
        TALLOC_FREE(tmp_debug_ctx);
 
+       errno = old_errno;
+
        return( 0 );
 }