knownhost_add: Avoid dereferencing uninitialized memory on error path.
knownhost_add: Avoid dereferencing uninitialized memory on error path.

In function knownhost_add, memory is alocated for a new entry. If normal
alocation is used, memory is not initialized to 0 right after, but a
check is done to verify if correct key type is passed. This test is done
BEFORE setting the memory to null, and on the error path function
free_host() is called, that tries to dereference unititialized memory,
resulting into a glibc abort().

 * knownhost.c - knownhost_add(): - move typemask check before alloc

libssh2/libssh2,libssh2/libssh2,libssh2/libssh2,libssh2/libssh2