From fa80f1a937b699bf93ceee85cd033424f6987b29 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 26 Mar 2016 02:46:54 +0100 Subject: s4:ntvfs: fix O3 error unused result of asprintf in cifspsx_list_unix Signed-off-by: Michael Adam Reviewed-by: Christian Ambach --- source4/ntvfs/cifs_posix_cli/svfs_util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/cifs_posix_cli/svfs_util.c b/source4/ntvfs/cifs_posix_cli/svfs_util.c index f351c5840ea..a9e6ba49925 100644 --- a/source4/ntvfs/cifs_posix_cli/svfs_util.c +++ b/source4/ntvfs/cifs_posix_cli/svfs_util.c @@ -94,6 +94,7 @@ struct cifspsx_dir *cifspsx_list_unix(TALLOC_CTX *mem_ctx, struct ntvfs_request unsigned int i = dir->count; char *full_name; char *low_name; + int ret; if (strchr(dent->d_name, ':') && !strchr(unix_path, ':')) { /* don't show streams in dir listing */ @@ -120,7 +121,11 @@ struct cifspsx_dir *cifspsx_list_unix(TALLOC_CTX *mem_ctx, struct ntvfs_request dir->files[i].name = low_name; if (!dir->files[i].name) { continue; } - asprintf(&full_name, "%s/%s", dir->unix_dir, dir->files[i].name); + ret = asprintf(&full_name, "%s/%s", dir->unix_dir, dir->files[i].name); + if (ret == -1) { + continue; + } + if (!full_name) { continue; } if (stat(full_name, &dir->files[i].st) == 0) { -- cgit v1.2.1