diff --git a/src/plugins/c/c_service_client_plugin.cpp b/src/plugins/c/c_service_client_plugin.cpp index 3b66a00..31d15c6 100644 --- a/src/plugins/c/c_service_client_plugin.cpp +++ b/src/plugins/c/c_service_client_plugin.cpp @@ -348,13 +348,14 @@ CServiceClientPlugin::GenerateSourceConnectFunctionDefinition(Service::Ptr servi ss << " assert(format != NULL);" << std::endl; ss << std::endl; ss << " int32_t status = 0;" << std::endl; - ss << " char address[1024];" << std::endl; + ss << " char *address = NULL;" << std::endl; ss << " va_list args;" << std::endl; ss << " va_start(args, format);" << std::endl; - ss << " vsnprintf(address, sizeof(address), format, args);" << std::endl; + ss << " vasprintf(&address, format, args); " << std::endl; ss << " va_end(args);" << std::endl; ss << std::endl; ss << " status = Client_Connect(client->impl, address);" << std::endl; + ss << " free(address); " << std::endl; ss << " if (status != 0) { return status; }" << std::endl; ss << std::endl; ss << " Client_SetCallback(client->impl, " << service->id() << "_Client_Dispatch, client);" << std::endl;