mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
Use calloc instead of ZERO_STRUCTP in talloc_stackframe_create()
This commit is contained in:
parent
6695b0e87d
commit
0f3040a61f
@ -68,22 +68,20 @@ static void talloc_stackframe_init(void * unused)
|
||||
static struct talloc_stackframe *talloc_stackframe_create(void)
|
||||
{
|
||||
#if defined(PARANOID_MALLOC_CHECKER)
|
||||
#ifdef malloc
|
||||
#undef malloc
|
||||
#ifdef calloc
|
||||
#undef calloc
|
||||
#endif
|
||||
#endif
|
||||
struct talloc_stackframe *ts = (struct talloc_stackframe *)malloc(
|
||||
sizeof(struct talloc_stackframe));
|
||||
struct talloc_stackframe *ts = (struct talloc_stackframe *)calloc(
|
||||
1, sizeof(struct talloc_stackframe));
|
||||
#if defined(PARANOID_MALLOC_CHECKER)
|
||||
#define malloc(s) __ERROR_DONT_USE_MALLOC_DIRECTLY
|
||||
#define calloc(n, s) __ERROR_DONT_USE_MALLOC_DIRECTLY
|
||||
#endif
|
||||
|
||||
if (!ts) {
|
||||
smb_panic("talloc_stackframe_init malloc failed");
|
||||
}
|
||||
|
||||
ZERO_STRUCTP(ts);
|
||||
|
||||
SMB_THREAD_ONCE(&ts_initialized, talloc_stackframe_init, NULL);
|
||||
|
||||
if (SMB_THREAD_SET_TLS(global_ts, ts)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user