verifier: clone the discovered vine_service 85/257385/2
authorCheoleun Moon <chleun.moon@samsung.com>
Fri, 23 Apr 2021 08:05:10 +0000 (17:05 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Fri, 23 Apr 2021 08:09:55 +0000 (17:09 +0900)
Change-Id: I50b1e27e9fa163ee14129621c39d0536ade7611a
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
tests/verifier/vine-verifier.cpp

index 93d0937..67c99a5 100644 (file)
@@ -348,6 +348,7 @@ static void __ip_resolved_cb(vine_session_h session, vine_service_h service,
                PRINT_IF_ERROR(ret, "vine_service_get_port");
 
                __connect_to_server(session, info->use_tls, info->use_psk, ip, address_family, port);
+               vine_service_destroy(service);
                free(info);
        }
 }
@@ -385,7 +386,9 @@ static void __discovered_cb(vine_session_h session, vine_service_h service,
                printf("\n");
                fflush(stdout);
 
-               ret = vine_session_set_ip_resolved_cb(session, service, __ip_resolved_cb, user_data);
+               vine_service_h s;
+               vine_service_clone(service, &s);
+               ret = vine_session_set_ip_resolved_cb(session, s, __ip_resolved_cb, user_data);
                PRINT_IF_ERROR(ret, "vine_session_set_ip_resolved_cb");
        }