The branch, master has been updated
       via  d7dcbcc lib/param: avoid talloc_reference() in copy_service()
      from  97818fd s3-rpcclient: add deldriverex flags argument

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


- Log -----------------------------------------------------------------
commit d7dcbcc42d9a8424ec2204a220b3b912b7be2f70
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Jan 11 13:47:08 2012 +0100

    lib/param: avoid talloc_reference() in copy_service()
    
    The memory reduction compared of talloc_reference() over talloc_strdup()
    is typically very low. As the strings are typically short compared
    to the talloc header overhead.
    
    metze
    
    Autobuild-User: Stefan Metzmacher <me...@samba.org>
    Autobuild-Date: Wed Jan 11 16:13:50 CET 2012 on sn-devel-104

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

Summary of changes:
 lib/param/loadparm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 949c404..03ee8f3 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2140,7 +2140,7 @@ static void copy_service(struct loadparm_service 
*pserviceDest,
                        /* If we already have same option, override it */
                        if (strcmp(pdata->key, data->key) == 0) {
                                talloc_free(pdata->value);
-                               pdata->value = talloc_reference(pdata,
+                               pdata->value = talloc_strdup(pdata,
                                                             data->value);
                                not_added = false;
                                break;
@@ -2151,8 +2151,8 @@ static void copy_service(struct loadparm_service 
*pserviceDest,
                        paramo = talloc_zero(pserviceDest, struct 
parmlist_entry);
                        if (paramo == NULL)
                                smb_panic("OOM");
-                       paramo->key = talloc_reference(paramo, data->key);
-                       paramo->value = talloc_reference(paramo, data->value);
+                       paramo->key = talloc_strdup(paramo, data->key);
+                       paramo->value = talloc_strdup(paramo, data->value);
                        DLIST_ADD(pserviceDest->param_opt, paramo);
                }
                data = data->next;


-- 
Samba Shared Repository

Reply via email to