From 9555f4adf51eb5c54239cd6aa1457b590fea1d75 Mon Sep 17 00:00:00 2001
From: Marc Hoersken <info@marc-hoersken.de>
Date: Sat, 18 May 2013 23:47:46 +0200
Subject: [PATCH] knownhost.c: use LIBSSH2_FREE macro instead of free

Use LIBSSH2_FREE instead of free since
_libssh2_base64_encode uses LIBSSH2_ALLOC
---
 src/knownhost.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/knownhost.c b/src/knownhost.c
index 1087bc2..8e1889c 100644
--- a/src/knownhost.c
+++ b/src/knownhost.c
@@ -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) +
-- 
1.8.0.msysgit.0

