The branch, master has been updated
       via  10e888f smbcontrol: Use server_id_str_buf
      from  6faef4d btrfs: don't leak opened directory handle

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


- Log -----------------------------------------------------------------
commit 10e888f6cee8cdc4c905d3c2788a47901bd42b2c
Author: Volker Lendecke <[email protected]>
Date:   Tue Nov 4 13:59:25 2014 +0100

    smbcontrol: Use server_id_str_buf
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>
    
    Autobuild-User(master): Martin Schwenke <[email protected]>
    Autobuild-Date(master): Wed Nov  5 13:03:39 CET 2014 on sn-devel-104

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

Summary of changes:
 source3/utils/smbcontrol.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index 164c48a..9af0f3e 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -121,12 +121,10 @@ static void print_pid_string_cb(struct messaging_context 
*msg,
                                struct server_id pid,
                                DATA_BLOB *data)
 {
-       char *pidstr;
+       struct server_id_buf pidstr;
 
-       pidstr = server_id_str(talloc_tos(), &pid);
-       printf("PID %s: %.*s", pidstr, (int)data->length,
-              (const char *)data->data);
-       TALLOC_FREE(pidstr);
+       printf("PID %s: %.*s", server_id_str_buf(pid, &pidstr),
+              (int)data->length, (const char *)data->data);
        num_replies++;
 }
 
@@ -442,9 +440,8 @@ static void pong_cb(struct messaging_context *msg,
                    struct server_id pid,
                    DATA_BLOB *data)
 {
-       char *src_string = server_id_str(NULL, &pid);
-       printf("PONG from pid %s\n", src_string);
-       TALLOC_FREE(src_string);
+       struct server_id_buf src_string;
+       printf("PONG from pid %s\n", server_id_str_buf(pid, &src_string));
        num_replies++;
 }
 
@@ -1235,10 +1232,10 @@ static void winbind_validate_cache_cb(struct 
messaging_context *msg,
                                      struct server_id pid,
                                      DATA_BLOB *data)
 {
-       char *src_string = server_id_str(NULL, &pid);
+       struct server_id_buf src_string;
        printf("Winbindd cache is %svalid. (answer from pid %s)\n",
-              (*(data->data) == 0 ? "" : "NOT "), src_string);
-       TALLOC_FREE(src_string);
+              (*(data->data) == 0 ? "" : "NOT "),
+              server_id_str_buf(pid, &src_string));
        num_replies++;
 }
 


-- 
Samba Shared Repository

Reply via email to