Fix memory leak on dest buffer on early return path

dest is allocated but not freed on an early return path
where dest is not used

Signed-off-by: Colin Ian King <colin.king@canonical.com>