set res->result to empty only if allocated
don't copy into NULL pointer, and set res-size to 0 instead

`*length= 0` is not required, is overwritten below. Instead, set
res->size
in fact res->size *must* be set, because if res->result is not empty,
res->ssize is not null, and *result will be set to a wrong value below
both lines are not required

res->result will always be NULL, since it is set directly before.
Setting *length is pointless since it is overwritten below (res->size
is alredy 0 here)
only free res->result if allocated
Merge pull request #1 from y-ken/unknown_host_bug

segmentation fault if host were unknown