Signed-off-by: Fabian Maurer dark.shadow4@web.de
-- v5: urlmon: Pass correct parameter to realloc and simplify code (Coverity)
From: Fabian Maurer dark.shadow4@web.de
Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/urlmon/sec_mgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c index e6d1864b1e7..ad22b1596e4 100644 --- a/dlls/urlmon/sec_mgr.c +++ b/dlls/urlmon/sec_mgr.c @@ -1276,13 +1276,13 @@ static LPDWORD build_zonemap_from_reg(void) if (used == allocated) { LPDWORD new_data;
+ allocated *= 2; new_data = realloc(data, allocated * sizeof(DWORD)); if (!new_data) goto cleanup; - memset(new_data + allocated, 0, allocated * sizeof(DWORD));
data = new_data; - allocated *= 2; + } data[used] = wcstol(name, NULL, 10); }
Alex Henrie (@alexhenrie) commented about dlls/urlmon/sec_mgr.c:
if (used == allocated) { LPDWORD new_data;
allocated *= 2; new_data = realloc(data, allocated * sizeof(DWORD)); if (!new_data) goto cleanup;
memset(new_data + allocated, 0, allocated * sizeof(DWORD)); data = new_data;
allocated *= 2;
Please just delete the line. It looks weird to have a blank line before a closing brace.