summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-22 16:49:56 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-22 16:49:56 +0200
commit02fac426901ca0ac95d63c374f8480825f5cf6bc (patch)
treecc10997c87c3ca23ed41d43e40764e5deb6f0b0a
parent1d9ea911e39b4619a0857171a3362bc2ff40bf96 (diff)
downloadsamba-02fac426901ca0ac95d63c374f8480825f5cf6bc.tar.gz
samba-02fac426901ca0ac95d63c374f8480825f5cf6bc.tar.bz2
samba-02fac426901ca0ac95d63c374f8480825f5cf6bc.zip
Change some dynamic allocations back to static buffers to fix build.
-rw-r--r--source4/torture/masktest.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index 5eccf86f11..ac29f5ba3a 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -79,15 +79,12 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
struct smbcli_session_options *session_options)
{
struct smbcli_state *c;
- char *server;
+ char server[256];
NTSTATUS status;
- server = smb_xstrdup(share+2);
+ safe_strcpy(server,share+2,sizeof(server));
share = strchr_m(server,'\\');
- if (!share) {
- SAFE_FREE(server);
- return NULL;
- }
+ if (!share) return NULL;
*share = 0;
share++;
@@ -100,8 +97,6 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
cmdline_credentials, resolve_ctx, ev,
options, session_options);
- SAFE_FREE(server);
-
if (!NT_STATUS_IS_OK(status)) {
return NULL;
}
@@ -170,7 +165,7 @@ static void testpair(TALLOC_CTX *mem_ctx, struct smbcli_state *cli, char *mask,
char *file)
{
int fnum;
- char *res1;
+ char res1[256];
char *res2;
static int count;
char *short_name = NULL;
@@ -179,7 +174,7 @@ static void testpair(TALLOC_CTX *mem_ctx, struct smbcli_state *cli, char *mask,
count++;
- res1 = talloc_strdup(mem_ctx, "---");
+ safe_strcpy(res1, "---", sizeof(res1));
state.mem_ctx = mem_ctx;
@@ -191,8 +186,9 @@ static void testpair(TALLOC_CTX *mem_ctx, struct smbcli_state *cli, char *mask,
smbcli_close(cli->tree, fnum);
resultp = res1;
+ short_name = talloc_strdup(mem_ctx, "");
get_real_name(mem_ctx, cli, &long_name, &short_name);
- res1 = talloc_strdup(mem_ctx, "---");
+ safe_strcpy(res1, "---", sizeof(res1));
smbcli_list_new(cli->tree, mask,
FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY,
RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO,