s4:ntvfs: fix O3 error unused result of asprintf in cifspsx_list_unix
authorMichael Adam <obnox@samba.org>
Sat, 26 Mar 2016 01:46:54 +0000 (02:46 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 12 May 2016 22:16:15 +0000 (00:16 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
source4/ntvfs/cifs_posix_cli/svfs_util.c

index f351c5840eadc536e50cd8e0ad239ce3db1e4d3c..a9e6ba49925b643d97bdcfb7e7303ed4b5ef9ce2 100644 (file)
@@ -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) {