Fixed segfault

ipaddr was sometimes empty, causing free to not like it. Don't free it
if we don't have to.

Signed-off-by: William Giokas <1007380@gmail.com>
Optimize for size

Signed-off-by: William Giokas <1007380@gmail.com>