SSH: Fix some memleaks.

This commit is contained in:
Vlad Grigorescu 2015-02-06 19:32:08 -05:00
parent fc721d2d25
commit 3190ca275e

View file

@ -425,6 +425,11 @@ refine connection SSH_Conn += {
kex_algorithm_ = bytestring();
%}
%cleanup{
kex_algorithm_.free();
kex_algs_cache_.free();
%}
function get_state(is_orig: bool): int
%{
if ( is_orig )
@ -514,6 +519,9 @@ refine connection SSH_Conn += {
kex_algorithm_.init((const uint8 *) client_list->Lookup(i)->AsStringVal()->Bytes(),
client_list->Lookup(i)->AsStringVal()->Len());
Unref(client_list);
Unref(server_list);
// UNTESTED
if ( update_kex_state_if_equal("rsa1024-sha1", KEX_RSA) )
return true;
@ -557,6 +565,9 @@ refine connection SSH_Conn += {
}
}
Unref(client_list);
Unref(server_list);
return true;
%}