From 4025361513068463390900635313910200542556 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 14 Nov 2023 18:35:38 -0500 Subject: Fix a number of leaks and bad uses of free in the api See https://github.com/Vector35/binaryninja-api/issues/4751 --- interaction.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'interaction.cpp') diff --git a/interaction.cpp b/interaction.cpp index 037edca6..5b62084e 100644 --- a/interaction.cpp +++ b/interaction.cpp @@ -661,7 +661,10 @@ bool BinaryNinja::GetFormInput(vector& fields, const string& tit // If user cancelled, there are no results if (!ok) + { + delete[] fieldBuf; return false; + } // Copy results to API structures for (size_t i = 0; i < fields.size(); i++) @@ -689,7 +692,10 @@ bool BinaryNinja::GetFormInput(vector& fields, const string& tit } } + // Free core-allocated results BNFreeFormInputResults(fieldBuf, fields.size()); + + delete[] fieldBuf; return true; } -- cgit v1.3.1