Fix: memory leak in connect error path

Fixes coverity issue 1072757.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: fix NULL dereference on error

Fixes coverity issue 1195182.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>