diff --git a/service_win32.cpp b/service_win32.cpp index b4e3c1f..93f8a8f 100644 --- a/service_win32.cpp +++ b/service_win32.cpp @@ -805,8 +805,10 @@ void TunsafeServiceServer::HandleDisconnect() { void TunsafeServiceServer::OnGraphAvailable() { if (want_graph_type_ != 0xffffffff) { LinearizedGraph *graph = service_backend_->backend_->GetGraph(want_graph_type_); - if (graph) + if (graph) { connection_->WritePacket(TS_SERVICE_MSG_GRAPH, (uint8*)graph, graph->total_size); + free(graph); + } } } diff --git a/tunsafe_win32.cpp b/tunsafe_win32.cpp index daea673..f786043 100644 --- a/tunsafe_win32.cpp +++ b/tunsafe_win32.cpp @@ -788,8 +788,9 @@ enum { }; static void UpdateGraphReq() { - if (g_backend && (g_current_tab != 1 || !g_ui_visible)) - g_backend->GetGraph(0); + if (g_backend && (g_current_tab != 1 || !g_ui_visible)) { + free(g_backend->GetGraph(-1)); + } } static void UpdateTabSelection() {