Fix memory leak in URL scanning code
note about compile errors with outdated config.h