svn commit: samba r25184 - in branches: SAMBA_3_2/source/lib SAMBA_3_2/source/smbd SAMBA_3_2_0/source/lib SAMBA_3_2_0/source/smbd

vlendec at samba.org vlendec at samba.org
Sat Sep 15 20:24:37 GMT 2007


Author: vlendec
Date: 2007-09-15 20:24:35 +0000 (Sat, 15 Sep 2007)
New Revision: 25184

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25184

Log:
Fix some C++ warnings and an uninitialized variable

Modified:
   branches/SAMBA_3_2/source/lib/charcnv.c
   branches/SAMBA_3_2/source/lib/util_str.c
   branches/SAMBA_3_2/source/smbd/msdfs.c
   branches/SAMBA_3_2/source/smbd/nttrans.c
   branches/SAMBA_3_2/source/smbd/trans2.c
   branches/SAMBA_3_2_0/source/lib/charcnv.c
   branches/SAMBA_3_2_0/source/lib/util_str.c
   branches/SAMBA_3_2_0/source/smbd/msdfs.c
   branches/SAMBA_3_2_0/source/smbd/nttrans.c
   branches/SAMBA_3_2_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/charcnv.c
===================================================================
--- branches/SAMBA_3_2/source/lib/charcnv.c	2007-09-15 20:14:17 UTC (rev 25183)
+++ branches/SAMBA_3_2/source/lib/charcnv.c	2007-09-15 20:24:35 UTC (rev 25184)
@@ -1493,7 +1493,7 @@
 			/* Have we got space to append the '\0' ? */
 			if (size <= dest_len) {
 				/* No, realloc. */
-				dest = TALLOC_REALLOC(ctx, dest,
+				dest = TALLOC_REALLOC_ARRAY(ctx, dest, char,
 						dest_len+1);
 				if (!dest) {
 					/* talloc fail. */

Modified: branches/SAMBA_3_2/source/lib/util_str.c
===================================================================
--- branches/SAMBA_3_2/source/lib/util_str.c	2007-09-15 20:14:17 UTC (rev 25183)
+++ branches/SAMBA_3_2/source/lib/util_str.c	2007-09-15 20:24:35 UTC (rev 25184)
@@ -995,7 +995,7 @@
 	/* We know a token can't be larger
 	 * than the entire list. */
 
-	tok = SMB_MALLOC(bufsize+1);
+	tok = SMB_MALLOC_ARRAY(char, bufsize+1);
 	if (!tok) {
 		return False;
 	}

Modified: branches/SAMBA_3_2/source/smbd/msdfs.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/msdfs.c	2007-09-15 20:14:17 UTC (rev 25183)
+++ branches/SAMBA_3_2/source/smbd/msdfs.c	2007-09-15 20:24:35 UTC (rev 25184)
@@ -1549,7 +1549,7 @@
 {
 	struct junction_map *jn = NULL;
 	int i=0;
-	size_t jn_count;
+	size_t jn_count = 0;
 	int sharecount = 0;
 
 	*p_num_jn = 0;

Modified: branches/SAMBA_3_2/source/smbd/nttrans.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/nttrans.c	2007-09-15 20:14:17 UTC (rev 25183)
+++ branches/SAMBA_3_2/source/smbd/nttrans.c	2007-09-15 20:24:35 UTC (rev 25184)
@@ -634,7 +634,7 @@
 		 */
 
 		dir_name_len = strlen(dir_fsp->fsp_name);
-		fname = TALLOC_SIZE(ctx, dir_name_len+2);
+		fname = TALLOC_ARRAY(ctx, char, dir_name_len+2);
 		if (!fname) {
 			reply_nterror(
 				req, NT_STATUS_NO_MEMORY);
@@ -1392,7 +1392,7 @@
 		 */
 
 		dir_name_len = strlen(dir_fsp->fsp_name);
-		fname = TALLOC_SIZE(ctx, dir_name_len+2);
+		fname = TALLOC_ARRAY(ctx, char, dir_name_len+2);
 		if (!fname) {
 			reply_nterror(
 				req, NT_STATUS_NO_MEMORY);

Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/trans2.c	2007-09-15 20:14:17 UTC (rev 25183)
+++ branches/SAMBA_3_2/source/smbd/trans2.c	2007-09-15 20:24:35 UTC (rev 25184)
@@ -4209,7 +4209,7 @@
 
 		case SMB_QUERY_FILE_UNIX_LINK:
 			{
-				char *buffer = TALLOC_SIZE(ctx, 1024);
+				char *buffer = TALLOC_ARRAY(ctx, char, 1024);
 
 				if (!buffer) {
 					reply_nterror(req, NT_STATUS_NO_MEMORY);

Modified: branches/SAMBA_3_2_0/source/lib/charcnv.c
===================================================================
--- branches/SAMBA_3_2_0/source/lib/charcnv.c	2007-09-15 20:14:17 UTC (rev 25183)
+++ branches/SAMBA_3_2_0/source/lib/charcnv.c	2007-09-15 20:24:35 UTC (rev 25184)
@@ -1493,7 +1493,7 @@
 			/* Have we got space to append the '\0' ? */
 			if (size <= dest_len) {
 				/* No, realloc. */
-				dest = TALLOC_REALLOC(ctx, dest,
+				dest = TALLOC_REALLOC_ARRAY(ctx, dest, char,
 						dest_len+1);
 				if (!dest) {
 					/* talloc fail. */

Modified: branches/SAMBA_3_2_0/source/lib/util_str.c
===================================================================
--- branches/SAMBA_3_2_0/source/lib/util_str.c	2007-09-15 20:14:17 UTC (rev 25183)
+++ branches/SAMBA_3_2_0/source/lib/util_str.c	2007-09-15 20:24:35 UTC (rev 25184)
@@ -994,7 +994,7 @@
 	/* We know a token can't be larger
 	 * than the entire list. */
 
-	tok = SMB_MALLOC(bufsize+1);
+	tok = SMB_MALLOC_ARRAY(char, bufsize+1);
 	if (!tok) {
 		return False;
 	}

Modified: branches/SAMBA_3_2_0/source/smbd/msdfs.c
===================================================================
--- branches/SAMBA_3_2_0/source/smbd/msdfs.c	2007-09-15 20:14:17 UTC (rev 25183)
+++ branches/SAMBA_3_2_0/source/smbd/msdfs.c	2007-09-15 20:24:35 UTC (rev 25184)
@@ -1549,7 +1549,7 @@
 {
 	struct junction_map *jn = NULL;
 	int i=0;
-	size_t jn_count;
+	size_t jn_count = 0;
 	int sharecount = 0;
 
 	*p_num_jn = 0;

Modified: branches/SAMBA_3_2_0/source/smbd/nttrans.c
===================================================================
--- branches/SAMBA_3_2_0/source/smbd/nttrans.c	2007-09-15 20:14:17 UTC (rev 25183)
+++ branches/SAMBA_3_2_0/source/smbd/nttrans.c	2007-09-15 20:24:35 UTC (rev 25184)
@@ -634,7 +634,7 @@
 		 */
 
 		dir_name_len = strlen(dir_fsp->fsp_name);
-		fname = TALLOC_SIZE(ctx, dir_name_len+2);
+		fname = TALLOC_ARRAY(ctx, char, dir_name_len+2);
 		if (!fname) {
 			reply_nterror(
 				req, NT_STATUS_NO_MEMORY);
@@ -1392,7 +1392,7 @@
 		 */
 
 		dir_name_len = strlen(dir_fsp->fsp_name);
-		fname = TALLOC_SIZE(ctx, dir_name_len+2);
+		fname = TALLOC_ARRAY(ctx, char, dir_name_len+2);
 		if (!fname) {
 			reply_nterror(
 				req, NT_STATUS_NO_MEMORY);

Modified: branches/SAMBA_3_2_0/source/smbd/trans2.c
===================================================================
--- branches/SAMBA_3_2_0/source/smbd/trans2.c	2007-09-15 20:14:17 UTC (rev 25183)
+++ branches/SAMBA_3_2_0/source/smbd/trans2.c	2007-09-15 20:24:35 UTC (rev 25184)
@@ -4162,7 +4162,7 @@
 
 		case SMB_QUERY_FILE_UNIX_LINK:
 			{
-				char *buffer = TALLOC_SIZE(ctx, 1024);
+				char *buffer = TALLOC_ARRAY(ctx, char, 1024);
 
 				if (!buffer) {
 					reply_nterror(req, NT_STATUS_NO_MEMORY);



More information about the samba-cvs mailing list