-- v2: wininet: Use the _recalloc function instead of reimplementing it.
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/wininet/ftp.c | 3 +-- dlls/wininet/internet.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index f3f586cd6e1..5ab28e34cdb 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -3802,13 +3802,12 @@ static BOOL FTP_ParseDirectory(ftp_session_t *lpwfs, INT nSocket, LPCWSTR lpszSe { LPFILEPROPERTIESW tmpafp;
- tmpafp = realloc(*lpafp, sizeof(FILEPROPERTIESW) * sizeFilePropArray * 2); + tmpafp = _recalloc(*lpafp, sizeFilePropArray * 2, sizeof(FILEPROPERTIESW)); if (NULL == tmpafp) { bSuccess = FALSE; break; } - memset(tmpafp + sizeFilePropArray, 0, sizeof(FILEPROPERTIESW) * sizeFilePropArray);
*lpafp = tmpafp; sizeFilePropArray *= 2; diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 6dabb0fc5e3..12a77af4cd6 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -121,9 +121,8 @@ void *alloc_object(object_header_t *parent, const object_vtbl_t *vtbl, size_t si } }else if(next_handle == handle_table_size) { num = handle_table_size * 2; - p = realloc(handle_table, sizeof(handle_table[0]) * num); + p = _recalloc(handle_table, num, sizeof(handle_table[0])); if(p) { - memset(p + handle_table_size, 0, sizeof(handle_table[0]) * handle_table_size); handle_table = p; handle_table_size = num; }else {
This merge request was closed by Alex Henrie.
Closing, see merge request !2197