diff options
| author | Peter LaFosse <peter@vector35.com> | 2020-04-02 17:56:10 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2020-04-02 17:56:10 -0400 |
| commit | fe5079471419f18142a627d00340c86fa844fdf4 (patch) | |
| tree | 6f692cb7fbfb3c546cc8e10e6455d9032de21a84 /binaryview.cpp | |
| parent | 182d5479b0a81e0c8c5f70d4fc6edd150279a87a (diff) | |
Fix some memory leaks
Diffstat (limited to 'binaryview.cpp')
| -rw-r--r-- | binaryview.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/binaryview.cpp b/binaryview.cpp index 5c0dd951..d1c44e97 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -409,7 +409,10 @@ BinaryView* TagType::GetView() const std::string TagType::GetName() const { - return BNTagTypeGetName(m_object); + char* str = BNTagTypeGetName(m_object); + string result = str; + BNFreeString(str); + return result; } @@ -725,13 +728,19 @@ Section::Section(BNSection* sec) std::string Section::GetName() const { - return BNSectionGetName(m_object); + char* str = BNSectionGetName(m_object); + string result = str; + BNFreeString(str); + return result; } std::string Section::GetType() const { - return BNSectionGetType(m_object); + char* str = BNSectionGetType(m_object); + string result = str; + BNFreeString(str); + return result; } |
