From: Volker Lendecke Date: Wed, 8 Aug 2018 12:20:58 +0000 (+0200) Subject: streams_xattr: Make error handling more obvious X-Git-Tag: tdb-1.3.17~1619 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aca0f2a18bf39e703a5cf8383ff2089fa0e97221;p=thirdparty%2Fsamba.git streams_xattr: Make error handling more obvious Do the NULL check right after the alloc call Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index 0743959e957..30459fec4bf 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -190,16 +190,21 @@ static bool streams_xattr_recheck(struct stream_io *sio) TALLOC_FREE(sio->base); sio->xattr_name = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(sio->handle, sio->fsp), xattr_name); - sio->base = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(sio->handle, sio->fsp), - sio->fsp->fsp_name->base_name); - sio->fsp_name_ptr = sio->fsp->fsp_name; - + if (sio->xattr_name == NULL) { + DBG_DEBUG("sio->xattr_name==NULL\n"); + return false; + } TALLOC_FREE(xattr_name); - if ((sio->xattr_name == NULL) || (sio->base == NULL)) { + sio->base = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(sio->handle, sio->fsp), + sio->fsp->fsp_name->base_name); + if (sio->base == NULL) { + DBG_DEBUG("sio->base==NULL\n"); return false; } + sio->fsp_name_ptr = sio->fsp->fsp_name; + return true; }