From: Timo Sirainen Date: Mon, 10 May 2004 01:01:24 +0000 (+0300) Subject: allow using data stack without data_stack_init(). X-Git-Tag: 1.1.alpha1~4114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9695f2748f86bce28b7bb0963f7524872e272f0f;p=thirdparty%2Fdovecot%2Fcore.git allow using data stack without data_stack_init(). --HG-- branch : HEAD --- diff --git a/src/lib/data-stack.c b/src/lib/data-stack.c index f141c6512f..3ddc461cd6 100644 --- a/src/lib/data-stack.c +++ b/src/lib/data-stack.c @@ -211,6 +211,11 @@ static void *t_malloc_real(size_t size, int permanent) if (size == 0 || size > SSIZE_T_MAX) i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size); + if (data_stack_frame == 0) { + /* kludgy, but allow this before initialization */ + data_stack_init(); + } + /* reset t_buffer_get() mark - not really needed but makes it easier to notice if t_malloc() is called between t_buffer_get() and t_buffer_alloc() */