svn commit: samba r5501 - in branches/SAMBA_4_0/source/ntvfs: ipc
posix
metze at samba.org
metze at samba.org
Tue Feb 22 11:35:40 GMT 2005
Author: metze
Date: 2005-02-22 11:35:38 +0000 (Tue, 22 Feb 2005)
New Revision: 5501
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5501
Log:
check the return of talloc with the NT_STATUS_HAVE_NO_MEMORY()
macro...
metze
Modified:
branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c
branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c 2005-02-22 11:33:33 UTC (rev 5500)
+++ branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c 2005-02-22 11:35:38 UTC (rev 5501)
@@ -80,7 +80,10 @@
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);
Modified: branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c 2005-02-22 11:33:33 UTC (rev 5500)
+++ branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c 2005-02-22 11:35:38 UTC (rev 5501)
@@ -107,12 +107,11 @@
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 @@
}
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 @@
/* 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 @@
/* 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;
More information about the samba-cvs
mailing list