Bugfix, was writing to last byte + 1 of curlResponseBuffer, corrupting the entire stack as the program ran. This could potentially have been the cause of all heap related corruption.