[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Sun Mar 21 10:13:05 MDT 2010


The branch, master has been updated
       via  d097d9f... Use TALLOC_FREE in talloc_pop()
       via  0f3040a... Use calloc instead of ZERO_STRUCTP in talloc_stackframe_create()
       via  6695b0e... Trim an overlong line
      from  6c39b10... s4:regshell - here we don't need a newline - "ctime" itself provides one

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit d097d9fb09ff1f4acc4c8407a1a7903b6ef197de
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 21 15:55:04 2010 +0100

    Use TALLOC_FREE in talloc_pop()

commit 0f3040a61fc51434e07ed5a87a89eda25e196514
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 21 15:16:27 2010 +0100

    Use calloc instead of ZERO_STRUCTP in talloc_stackframe_create()

commit 6695b0e87d135dff759ce202cf61de49e062e946
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 21 15:14:48 2010 +0100

    Trim an overlong line

-----------------------------------------------------------------------

Summary of changes:
 lib/util/talloc_stack.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/talloc_stack.c b/lib/util/talloc_stack.c
index f34d495..8e559cc 100644
--- a/lib/util/talloc_stack.c
+++ b/lib/util/talloc_stack.c
@@ -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)) {
@@ -102,8 +100,7 @@ static int talloc_pop(TALLOC_CTX *frame)
 		if (frame == ts->talloc_stack[i]) {
 			break;
 		}
-		talloc_free(ts->talloc_stack[i]);
-		ts->talloc_stack[i] = NULL;
+		TALLOC_FREE(ts->talloc_stack[i]);
 	}
 
 	ts->talloc_stack[i] = NULL;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list