diff --git a/channels/drive/client/drive_file.c b/channels/drive/client/drive_file.c index 9ef437e40..8ad353d3a 100644 --- a/channels/drive/client/drive_file.c +++ b/channels/drive/client/drive_file.c @@ -145,9 +145,8 @@ static BOOL drive_file_set_fullpath(DRIVE_FILE* file, WCHAR* fullpath) const size_t len = _wcslen(fullpath); free(file->fullpath); - free(file->filename); file->fullpath = NULL; - file->filename = NULL; + if (len == 0) return TRUE; @@ -158,10 +157,6 @@ static BOOL drive_file_set_fullpath(DRIVE_FILE* file, WCHAR* fullpath) if (_wcsncmp(filename, sep, ARRAYSIZE(sep)) == 0) *filename = '\0'; - if (!filename || (_wcsnlen(filename, 2) <= 1)) - file->filename = _wcsdup(file->fullpath); - else - file->filename = _wcsdup(&filename[1]); return TRUE; } @@ -365,7 +360,6 @@ BOOL drive_file_free(DRIVE_FILE* file) fail: DEBUG_WSTR("Free %s", file->fullpath); free(file->fullpath); - free(file->filename); free(file); return rc; } diff --git a/channels/drive/client/drive_file.h b/channels/drive/client/drive_file.h index df8b6aa60..761295b65 100644 --- a/channels/drive/client/drive_file.h +++ b/channels/drive/client/drive_file.h @@ -41,7 +41,6 @@ typedef struct WIN32_FIND_DATAW find_data; const WCHAR* basepath; WCHAR* fullpath; - WCHAR* filename; BOOL delete_pending; UINT32 FileAttributes; UINT32 SharedAccess;