{
connection_struct *conn = req->conn;
char *path = NULL;
- const char *mask = NULL;
+ char *mask = NULL;
char *directory = NULL;
struct smb_filename *smb_fname = NULL;
char *fname = NULL;
p = strrchr_m(directory,'/');
if ((p != NULL) && (*directory != '/')) {
- mask = p + 1;
+ mask = talloc_strdup(ctx, p + 1);
directory = talloc_strndup(ctx, directory,
PTR_DIFF(p, directory));
} else {
- mask = directory;
+ mask = talloc_strdup(ctx, directory);
directory = talloc_strdup(ctx,".");
}
goto out;
}
- mask = dptr_wcard(sconn, dptr_num);
+ mask = talloc_strdup(ctx, dptr_wcard(sconn, dptr_num));
if (!mask) {
goto SearchEmpty;
}
maxentries ));
out:
TALLOC_FREE(directory);
+ TALLOC_FREE(mask);
TALLOC_FREE(smb_fname);
END_PROFILE(SMBsearch);
return;