riscv64: Add RISC-V to supported architectures
[platform/core/connectivity/bluetooth-agent.git] / ipsp-agent / bluetooth-ipsp-agent.c
index fd2f0dc..8ad155c 100644 (file)
@@ -492,8 +492,7 @@ static void __generate_eui64_address(char *hw_addr, char **eui64_addr)
                        strncpy(addr[i], copied, sizeof(addr[i]) - 1);
                        addr[i][(int)(sizeof(addr[i]) - 1)] = '\0';
                } else {
-                       strncpy(addr[i], copied, strlen(copied));
-                       addr[i][(int)strlen(copied)] = '\0';
+                       strncpy(addr[i], copied, sizeof(addr[i]));
                }
 
                BT_DBG("copied/ptr (%s/%s)", copied, ptr);
@@ -710,6 +709,10 @@ static void __bt_ipsp_dbus_method(GDBusConnection *connection,
 
                __bt_ipsp_execute_dhcp6_server();
 
+               if (net_connection) {
+                       connection_destroy(net_connection);
+                       net_connection = NULL;
+               }
        } else if (g_strcmp0(method_name, "SetIpv6Addr") == 0) {
                int ret;
                BT_DBG("");
@@ -756,6 +759,8 @@ static void __bt_ipsp_dbus_method(GDBusConnection *connection,
                g_free(network_ipv6_address);
                g_free(remote_ipv6_address);
                g_free(network_interface);
+               g_free(ifname);
+               g_free(address);
        }
 
        BT_DBG("-");