track origins when testing with valgrind
fixed memleak in retrieve_url()