diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-09-15 20:24:35 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:30:49 -0500 |
commit | ad97bcf813d5f06df4711896eefc99c0c32651cc (patch) | |
tree | 8a65bf71ee5c2a339a4db7fc4aa9c0fa4462e53e | |
parent | f82eb0fef609e6f24f4d60142292c557cd1fe5fd (diff) | |
download | samba-ad97bcf813d5f06df4711896eefc99c0c32651cc.tar.gz samba-ad97bcf813d5f06df4711896eefc99c0c32651cc.tar.bz2 samba-ad97bcf813d5f06df4711896eefc99c0c32651cc.zip |
r25184: Fix some C++ warnings and an uninitialized variable
(This used to be commit b64df8a3c504ab7749c21ffb26e4771a9a0a328f)
-rw-r--r-- | source3/lib/charcnv.c | 2 | ||||
-rw-r--r-- | source3/lib/util_str.c | 2 | ||||
-rw-r--r-- | source3/smbd/msdfs.c | 2 | ||||
-rw-r--r-- | source3/smbd/nttrans.c | 4 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index 26581ba305..a8fb95df06 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -1493,7 +1493,7 @@ static size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx, /* 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. */ diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index c2eeb12544..db5775b79f 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -995,7 +995,7 @@ BOOL in_list(const char *s, const char *list, BOOL casesensitive) /* 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; } diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 56089fbe95..69612dc571 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -1549,7 +1549,7 @@ struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx, size_t *p_num_jn) { struct junction_map *jn = NULL; int i=0; - size_t jn_count; + size_t jn_count = 0; int sharecount = 0; *p_num_jn = 0; diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 14a11c3fe3..dce0d6188d 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -634,7 +634,7 @@ void reply_ntcreate_and_X(connection_struct *conn, */ 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 @@ static void call_nt_transact_create(connection_struct *conn, */ 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); diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 478f60d094..ada4868bf8 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -4209,7 +4209,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd 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); |