memory leak fixed in service_read