From 8e521379d598d6ddf2d6967d70381eee2c1968b7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 26 Mar 2016 01:53:00 +0100 Subject: s4:ntvfs: fix O3 error unused result of asprintf in svfs_map_fileinfo Signed-off-by: Michael Adam Reviewed-by: Christian Ambach --- source4/ntvfs/simple/vfs_simple.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c index 38ecdfe66b3..abd76d25c88 100644 --- a/source4/ntvfs/simple/vfs_simple.c +++ b/source4/ntvfs/simple/vfs_simple.c @@ -206,7 +206,7 @@ static NTSTATUS svfs_map_fileinfo(struct ntvfs_module_context *ntvfs, { struct svfs_dir *dir = NULL; char *pattern = NULL; - int i; + int i, ret; const char *s, *short_name; s = strrchr(unix_path, '/'); @@ -216,8 +216,11 @@ static NTSTATUS svfs_map_fileinfo(struct ntvfs_module_context *ntvfs, short_name = ""; } - asprintf(&pattern, "%s:*", unix_path); - + ret = asprintf(&pattern, "%s:*", unix_path); + if (ret == -1) { + return NT_STATUS_NO_MEMORY; + } + if (pattern) { dir = svfs_list_unix(req, req, pattern); } -- cgit v1.2.1