mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-24 19:54:25 -04:00
[misc] add a few more missing calloc checks
* Also use the relevant macro in msapi_utf8.h
This commit is contained in:
parent
a10ea1498b
commit
c0393aec08
3 changed files with 72 additions and 66 deletions
|
@ -561,7 +561,7 @@ static __inline int SHDeleteDirectoryExU(HWND hwnd, const char* pszPath, FILEOP_
|
|||
// String needs to be double NULL terminated, so we just use the length of the UTF-8 string
|
||||
// which is always expected to be larger than our UTF-16 one, and add 2 chars for good measure.
|
||||
size_t wpszPath_len = strlen(pszPath) + 2;
|
||||
wchar_t* wpszPath = (wchar_t*)calloc(wpszPath_len, sizeof(wchar_t));
|
||||
walloc(pszPath, wpszPath_len);
|
||||
SHFILEOPSTRUCTW shfo = { hwnd, FO_DELETE, wpszPath, NULL, fFlags, FALSE, NULL, NULL };
|
||||
utf8_to_wchar_no_alloc(pszPath, wpszPath, (int)wpszPath_len);
|
||||
// FOF_SILENT | FOF_NOERRORUI | FOF_NOCONFIRMATION,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue