Vitaliy Margolen wine-patches@kievinfo.com writes:
if (!have_joydevs)joydevs = HeapAlloc(GetProcessHeap(), 0, sizeof(struct JoyDev));elsejoydevs = HeapReAlloc(GetProcessHeap(), 0, joydevs, (1 + have_joydevs) * sizeof(struct JoyDev));if (!joydevs){close(fd);continue;}
While you are fixing it you should fix it properly by preserving the old pointer on failure.