[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Sat Jul 28 21:22:02 MDT 2012


The branch, master has been updated
       via  9c9df9c s3-libsmbclient: Add missing talloc_stackframe() calls
      from  6a37b55 s4-dbcheck: Add lastKnownParent when moving an object to lostAndFound

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


- Log -----------------------------------------------------------------
commit 9c9df9c8a320741f13e129f768f3df77949e939a
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun Jul 29 11:25:04 2012 +1000

    s3-libsmbclient: Add missing talloc_stackframe() calls
    
    These caused a panic with the new assertion on the talloc stackframe being
    in place.
    
    Andrew Bartlett
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Sun Jul 29 05:21:24 CEST 2012 on sn-devel-104

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

Summary of changes:
 source3/libsmb/libsmb_context.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c
index 502bb0d..b529cbe 100644
--- a/source3/libsmb/libsmb_context.c
+++ b/source3/libsmb/libsmb_context.c
@@ -123,9 +123,11 @@ SMBC_module_init(void * punused)
 static void
 SMBC_module_terminate(void)
 {
+    TALLOC_CTX *frame = talloc_stackframe();
     secrets_shutdown();
     gfree_all();
     SMBC_initialized = false;
+    TALLOC_FREE(frame);
 }
 
 
@@ -136,6 +138,7 @@ SMBCCTX *
 smbc_new_context(void)
 {
         SMBCCTX *context;
+	TALLOC_CTX *frame = talloc_stackframe();
 
         /* The first call to this function should initialize the module */
         SMB_THREAD_ONCE(&SMBC_initialized, SMBC_module_init, NULL);
@@ -146,6 +149,7 @@ smbc_new_context(void)
          */
         context = SMB_MALLOC_P(SMBCCTX);
         if (!context) {
+		TALLOC_FREE(frame);
                 errno = ENOMEM;
                 return NULL;
         }
@@ -154,6 +158,7 @@ smbc_new_context(void)
 
         context->internal = SMB_MALLOC_P(struct SMBC_internal_data);
         if (!context->internal) {
+		TALLOC_FREE(frame);
                 SAFE_FREE(context);
                 errno = ENOMEM;
                 return NULL;
@@ -221,6 +226,7 @@ smbc_new_context(void)
         smbc_setFunctionListPrintJobs(context, SMBC_list_print_jobs_ctx);
         smbc_setFunctionUnlinkPrintJob(context, SMBC_unlink_print_job_ctx);
 
+	TALLOC_FREE(frame);
         return context;
 }
 
@@ -235,11 +241,14 @@ int
 smbc_free_context(SMBCCTX *context,
                   int shutdown_ctx)
 {
+	TALLOC_CTX *frame;
         if (!context) {
                 errno = EBADF;
                 return 1;
         }
 
+	frame = talloc_stackframe();
+
         if (shutdown_ctx) {
                 SMBCFILE * f;
                 DEBUG(1,("Performing aggressive shutdown.\n"));
@@ -278,18 +287,21 @@ smbc_free_context(SMBCCTX *context,
                         DEBUG(1, ("Could not purge all servers, "
                                   "free_context failed.\n"));
                         errno = EBUSY;
+			TALLOC_FREE(frame);
                         return 1;
                 }
                 if (context->internal->servers) {
                         DEBUG(1, ("Active servers in context, "
                                   "free_context failed.\n"));
                         errno = EBUSY;
+			TALLOC_FREE(frame);
                         return 1;
                 }
                 if (context->internal->files) {
                         DEBUG(1, ("Active files in context, "
                                   "free_context failed.\n"));
                         errno = EBUSY;
+			TALLOC_FREE(frame);
                         return 1;
                 }
         }
@@ -325,6 +337,7 @@ smbc_free_context(SMBCCTX *context,
                 smb_panic("error unlocking 'initialized_ctx_count'");
 	}
 
+	TALLOC_FREE(frame);
         return 0;
 }
 
@@ -347,6 +360,8 @@ smbc_option_set(SMBCCTX *context,
                 const char *s;
         } option_value;
 
+	TALLOC_CTX *frame = talloc_stackframe();
+
         va_start(ap, option_name);
 
         if (strcmp(option_name, "debug_to_stderr") == 0) {
@@ -413,6 +428,7 @@ smbc_option_set(SMBCCTX *context,
         }
 
         va_end(ap);
+	TALLOC_FREE(frame);
 }
 
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list