[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha6-144-g6baf760

Volker Lendecke vlendec at samba.org
Sun Jan 25 19:53:30 GMT 2009


The branch, master has been updated
       via  6baf760d176cc5ea8eb0cba6d68171f1950c1b75 (commit)
       via  28b7c44de846930e5f7c9aae3a7a423368c03ae1 (commit)
      from  c0fea1f0f791f0b2a161f5c89fd532ce2270c240 (commit)

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


- Log -----------------------------------------------------------------
commit 6baf760d176cc5ea8eb0cba6d68171f1950c1b75
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jan 25 20:33:22 2009 +0100

    Fix an error path memleak

commit 28b7c44de846930e5f7c9aae3a7a423368c03ae1
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jan 25 20:32:59 2009 +0100

    Make smb_bytes_push_str deal with a NULL buf returning NULL

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

Summary of changes:
 source3/libsmb/clifile.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 7c75826..ecb2bf0 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -783,10 +783,15 @@ int cli_nt_create(struct cli_state *cli, const char *fname, uint32 DesiredAccess
 
 uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str)
 {
-	size_t buflen = talloc_get_size(buf);
+	size_t buflen;
 	char *converted;
 	size_t converted_size;
 
+	if (buf == NULL) {
+		return NULL;
+	}
+
+	buflen = talloc_get_size(buf);
 	/*
 	 * We're pushing into an SMB buffer, align odd
 	 */
@@ -809,6 +814,7 @@ uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str)
 	buf = TALLOC_REALLOC_ARRAY(NULL, buf, uint8_t,
 				   buflen + converted_size);
 	if (buf == NULL) {
+		TALLOC_FREE(converted);
 		return NULL;
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list