I just realized that the memset in build_zonemap_from_reg is completely unnecessary. You can simplify the code like this:
``` if (used == allocated) { LPDWORD new_data;
allocated *= 2; new_data = realloc(data, allocated * sizeof(DWORD)); if (!new_data) goto cleanup;
data = new_data; } ```