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 --- binaryninjaapi.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 32db3582..0052e3ed 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -3625,6 +3625,7 @@ namespace BinaryNinja { static BNTag** CreateTagList(const std::vector>& tags, size_t* count); static std::vector> ConvertTagList(BNTag** tags, size_t count); + static void FreeTagList(BNTag** tags, size_t count); static std::vector> ConvertAndFreeTagList(BNTag** tags, size_t count); }; @@ -3655,6 +3656,7 @@ namespace BinaryNinja { static BNTagReference* CreateTagReferenceList(const std::vector& tags, size_t* count); static std::vector ConvertTagReferenceList(BNTagReference* tags, size_t count); + static void FreeTagReferenceList(BNTagReference* tags, size_t count); static std::vector ConvertAndFreeTagReferenceList(BNTagReference* tags, size_t count); }; @@ -9470,6 +9472,7 @@ namespace BinaryNinja { static PossibleValueSet FromAPIObject(BNPossibleValueSet& value); BNPossibleValueSet ToAPIObject(); + static void FreeAPIObject(BNPossibleValueSet* value); }; class FlowGraph; @@ -15255,6 +15258,7 @@ namespace BinaryNinja { BNType* type, const BNInstructionTextToken* prefix, size_t prefixCount, size_t width, size_t* count, BNTypeContext* typeCxt, size_t ctxCount); static void FreeCallback(void* ctxt); + static void FreeLinesCallback(void* ctxt, BNDisassemblyTextLine* lines, size_t count); public: DataRenderer(); -- cgit v1.3.1