X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Ftools_static_test.c;h=64da9834468825dfa2779551c8813a82afefe1d4;hb=dfe7b622b128e7bfb4a5e1f7e0afdb84e6001d14;hp=9e156ec6919e33b109f674662254996a3eadea75;hpb=68d09fa5028e47e763c44c30647da31e77eda64a;p=ric-plt%2Flib%2Frmr.git diff --git a/test/tools_static_test.c b/test/tools_static_test.c index 9e156ec..64da983 100644 --- a/test/tools_static_test.c +++ b/test/tools_static_test.c @@ -107,12 +107,15 @@ static int tools_test( ) { hname = uta_h2ip( "192.168.1.2" ); errors += fail_not_equal( strcmp( hname, "192.168.1.2" ), 0, "h2ip did not return IP address when given address" ); errors += fail_if_nil( hname, "h2ip did not return a pointer" ); + free( hname ); hname = uta_h2ip( "yahoo.com" ); errors += fail_if_nil( hname, "h2ip did not return a pointer" ); + free( hname ); hname = uta_h2ip( "yahoo.com:1234" ); // should ignore the port errors += fail_if_nil( hname, "h2ip did not return a pointer" ); + free( hname ); // ------------ rtg lookup test ------------------------------------------------------------- ctx.rtg_port = 0; @@ -188,6 +191,7 @@ static int tools_test( ) { ip = get_default_ip( if_list ); if( ip ) { + free( ip ); } else { errors += fail_if_nil( ip, "get_defaul_ip returned nil pointer when valid pointer expected" ); } @@ -203,6 +207,8 @@ static int tools_test( ) { } else { errors += fail_if_nil( if_list, "mk_ip_list with a specific interface name returned a nil list" ); } + + free( ip ); } // -------------------------------------------------------------------------------------------------