summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/ntvfs/simple/vfs_simple.c9
1 files changed, 6 insertions, 3 deletions
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);
}