summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-02-22 11:35:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:10:51 -0500
commit218f289ed75e9e10feadb92fbbb41e69025ab010 (patch)
tree7a3bc28d9290bb38be3c3af4886ba04696fc5872 /source4
parent90428a44a91d0a97769ba6c2d8459c35a9e96b12 (diff)
downloadsamba-218f289ed75e9e10feadb92fbbb41e69025ab010.tar.gz
samba-218f289ed75e9e10feadb92fbbb41e69025ab010.tar.bz2
samba-218f289ed75e9e10feadb92fbbb41e69025ab010.zip
r5501: check the return of talloc with the NT_STATUS_HAVE_NO_MEMORY()
macro... metze (This used to be commit 9ec6c0e97765e60ef195296f17d6a27b5d0dcca9)
Diffstat (limited to 'source4')
-rw-r--r--source4/ntvfs/ipc/vfs_ipc.c3
-rw-r--r--source4/ntvfs/posix/vfs_posix.c24
2 files changed, 12 insertions, 15 deletions
diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c
index 04a1a06db3..abb4c51f65 100644
--- a/source4/ntvfs/ipc/vfs_ipc.c
+++ b/source4/ntvfs/ipc/vfs_ipc.c
@@ -80,7 +80,10 @@ static NTSTATUS ipc_connect(struct ntvfs_module_context *ntvfs,
struct ipc_private *private;
tcon->fs_type = talloc_strdup(tcon, "IPC");
+ NT_STATUS_HAVE_NO_MEMORY(tcon->fs_type);
+
tcon->dev_type = talloc_strdup(tcon, "IPC");
+ NT_STATUS_HAVE_NO_MEMORY(tcon->dev_type);
/* prepare the private state for this connection */
private = talloc(tcon, struct ipc_private);
diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c
index 529ff7a98b..ec8db07d01 100644
--- a/source4/ntvfs/posix/vfs_posix.c
+++ b/source4/ntvfs/posix/vfs_posix.c
@@ -107,12 +107,11 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs,
NTSTATUS status;
pvfs = talloc_zero(tcon, struct pvfs_state);
- if (pvfs == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
+ NT_STATUS_HAVE_NO_MEMORY(pvfs);
/* for simplicity of path construction, remove any trailing slash now */
base_directory = talloc_strdup(pvfs, lp_pathname(tcon->service));
+ NT_STATUS_HAVE_NO_MEMORY(base_directory);
trim_string(base_directory, NULL, "/");
pvfs->tcon = tcon;
@@ -127,7 +126,10 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs,
}
tcon->fs_type = talloc_strdup(tcon, "NTFS");
+ NT_STATUS_HAVE_NO_MEMORY(tcon->fs_type);
+
tcon->dev_type = talloc_strdup(tcon, "A:");
+ NT_STATUS_HAVE_NO_MEMORY(tcon->dev_type);
ntvfs->private_data = pvfs;
@@ -153,20 +155,14 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs,
/* allocate the fnum id -> ptr tree */
pvfs->idtree_fnum = idr_init(pvfs);
- if (pvfs->idtree_fnum == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
+ NT_STATUS_HAVE_NO_MEMORY(pvfs->idtree_fnum);
/* allocate the search handle -> ptr tree */
pvfs->idtree_search = idr_init(pvfs);
- if (pvfs->idtree_search == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
+ NT_STATUS_HAVE_NO_MEMORY(pvfs->idtree_search);
status = pvfs_mangle_init(pvfs);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
+ NT_STATUS_NOT_OK_RETURN(status);
pvfs_setup_options(pvfs);
@@ -200,9 +196,7 @@ static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs,
/* resolve the cifs name to a posix name */
status = pvfs_resolve_name(pvfs, req, cp->in.path, 0, &name);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
+ NT_STATUS_NOT_OK_RETURN(status);
if (!name->exists) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;