s4:ntvfs: fix O3 error unused result of asprintf in cifspsx_map_fileinfo
authorMichael Adam <obnox@samba.org>
Sat, 26 Mar 2016 01:24:08 +0000 (02:24 +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/vfs_cifs_posix.c

index d384dbbca058b018cc9ec0fe948ecd7d2ebee978..9c1e6f6ab23c411a074be26948be7e4c33b3c67a 100644 (file)
@@ -209,7 +209,7 @@ static NTSTATUS cifspsx_map_fileinfo(struct ntvfs_module_context *ntvfs,
 {
        struct cifspsx_dir *dir = NULL;
        char *pattern = NULL;
-       int i;
+       int i, ret;
        const char *s, *short_name;
 
        s = strrchr(unix_path, '/');
@@ -219,8 +219,11 @@ static NTSTATUS cifspsx_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 = cifspsx_list_unix(req, req, pattern);
        }