knownhost.c: use LIBSSH2_FREE macro instead of free

Use LIBSSH2_FREE instead of free since
_libssh2_base64_encode uses LIBSSH2_ALLOC
This commit is contained in:
Marc Hoersken 2013-05-18 23:47:46 +02:00 committed by Peter Stuge
parent 1ad20ac7d3
commit edd42304a2

View File

@ -988,7 +988,7 @@ knownhost_writeline(LIBSSH2_KNOWNHOSTS *hosts,
node->salt, node->salt_len,
&saltalloc);
if(!nlen) {
free(namealloc);
LIBSSH2_FREE(hosts->session, namealloc);
return _libssh2_error(hosts->session, LIBSSH2_ERROR_ALLOC,
"Unable to allocate memory for "
"base64-encoded salt");
@ -1009,8 +1009,8 @@ knownhost_writeline(LIBSSH2_KNOWNHOSTS *hosts,
rc = _libssh2_error(hosts->session, LIBSSH2_ERROR_BUFFER_TOO_SMALL,
"Known-host write buffer too small");
free(namealloc);
free(saltalloc);
LIBSSH2_FREE(hosts->session, namealloc);
LIBSSH2_FREE(hosts->session, saltalloc);
}
else {
nlen = strlen(node->name) + strlen(keytype) + strlen(node->key) +