diff options
| author | Glenn Smith <glenn@vector35.com> | 2023-11-14 18:35:38 -0500 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2023-11-14 18:35:38 -0500 |
| commit | 4025361513068463390900635313910200542556 (patch) | |
| tree | 2dbfc8ef20c3eae8d849a02d833917dc24b28d28 /interaction.cpp | |
| parent | 814d840c8d12dfcfb60a5bf172ea494825fd30c1 (diff) | |
Fix a number of leaks and bad uses of free in the api
See https://github.com/Vector35/binaryninja-api/issues/4751
Diffstat (limited to 'interaction.cpp')
| -rw-r--r-- | interaction.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<FormInputField>& 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<FormInputField>& fields, const string& tit } } + // Free core-allocated results BNFreeFormInputResults(fieldBuf, fields.size()); + + delete[] fieldBuf; return true; } |
