1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:smbd: avoid string_set() in dir.c

And do some more error checks.

metze
This commit is contained in:
Stefan Metzmacher 2011-11-10 10:39:34 +01:00
parent 538748132f
commit 7644547a55

View File

@ -280,7 +280,7 @@ done:
/* Lanman 2 specific code */
SAFE_FREE(dptr->wcard);
string_set(&dptr->path,"");
SAFE_FREE(dptr->path);
SAFE_FREE(dptr);
}
@ -563,7 +563,13 @@ NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp,
dptr->dnum += 1; /* Always bias the dnum by one - no zero dnums allowed. */
string_set(&dptr->path,path);
dptr->path = SMB_STRDUP(path);
if (!dptr->path) {
bitmap_clear(sconn->searches.dptr_bmap, dptr->dnum - 1);
SAFE_FREE(dptr);
TALLOC_FREE(dir_hnd);
return NT_STATUS_NO_MEMORY;
}
dptr->conn = conn;
dptr->dir_hnd = dir_hnd;
dptr->spid = spid;
@ -571,6 +577,7 @@ NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp,
dptr->wcard = SMB_STRDUP(wcard);
if (!dptr->wcard) {
bitmap_clear(sconn->searches.dptr_bmap, dptr->dnum - 1);
SAFE_FREE(dptr->path);
SAFE_FREE(dptr);
TALLOC_FREE(dir_hnd);
return NT_STATUS_NO_MEMORY;