summaryrefslogtreecommitdiffstats
path: root/lib/util/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/debug.c')
-rw-r--r--lib/util/debug.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 013f34c2c5..ffd8e035eb 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -142,7 +142,7 @@ int *DEBUGLEVEL_CLASS = discard_const_p(int, debug_class_list_initial);
static int debug_count = 0;
static int current_msg_level = 0;
-static char *format_bufr = NULL;
+static char format_bufr[FORMAT_BUFR_SIZE];
static size_t format_pos = 0;
static bool log_overflow = false;
@@ -200,8 +200,6 @@ void gfree_debugsyms(void)
DEBUGLEVEL_CLASS = discard_const_p(int, debug_class_list_initial);
}
- TALLOC_FREE(format_bufr);
-
debug_num_classes = 0;
state.initialized = false;
@@ -461,10 +459,6 @@ static void debug_init(void)
for(p = default_classname_table; *p; p++) {
debug_add_class(*p);
}
- format_bufr = talloc_array(NULL, char, FORMAT_BUFR_SIZE);
- if (!format_bufr) {
- smb_panic("debug_init: unable to create buffer");
- }
}
/* This forces in some smb.conf derived values into the debug system.
@@ -906,9 +900,7 @@ static void format_debug_text( const char *msg )
size_t i;
bool timestamp = (state.logtype == DEBUG_FILE && (state.settings.timestamp_logs));
- if (!format_bufr) {
- debug_init();
- }
+ debug_init();
for( i = 0; msg[i]; i++ ) {
/* Indent two spaces at each new line. */