[PATCH 1/2] vfs: Fix building the glusterfs module.

Andreas Schneider asn at samba.org
Mon Nov 4 04:32:04 MST 2013


Using calloc directly throws an error. This fixes building the glusterfs
module.

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 source3/modules/vfs_glusterfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index 237236a..c944276 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -707,12 +707,12 @@ static char *vfs_gluster_getwd(struct vfs_handle_struct *handle)
 	char *cwd;
 	char *ret;
 
-	cwd = calloc(1, PATH_MAX + 1);
+	cwd = SMB_CALLOC_ARRAY(char, PATH_MAX);
 	if (cwd == NULL) {
 		return NULL;
 	}
 
-	ret = glfs_getcwd(handle->data, cwd, PATH_MAX);
+	ret = glfs_getcwd(handle->data, cwd, PATH_MAX - 1);
 	if (ret == 0) {
 		free(cwd);
 	}
-- 
1.8.3.1




More information about the samba-technical mailing list