You are overkilling the idea of the query to get the url.
The simplest way and best way at the same time is:
<?php
// get_the_ID() will return the current's post id
// get_the_permalink() will return the current url
$current_url = get_the_permalink(get_the_ID());
?>
That function will not echo, but rather return/get the permalink url for you. You can then incorporate the url by adding
...stuffbeforeurl<?php echo $current_url; ?>...stuffafterurl
into your link.