s4:ntvfs: fix O3 error unused result of asprintf
authorMichael Adam <obnox@samba.org>
Sat, 26 Mar 2016 00:53:00 +0000 (01:53 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 12 May 2016 22:16:15 +0000 (00:16 +0200)
in svfs_map_fileinfo

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
source4/ntvfs/simple/vfs_simple.c

index 38ecdfe66b31f049d1cf4143e4aba562a0df4443..abd76d25c8816e618f03a365b2221977a888d282 100644 (file)
@@ -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);
        }