From aaa46173de2bb3ecba95ca8bec0d6a661521bae9 Mon Sep 17 00:00:00 2001 From: ldeffenb Date: Thu, 22 Jun 2017 12:09:10 -0400 Subject: [PATCH] Free the newly allocated string, not the local buffer --- src/zl-util/STLString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zl-util/STLString.cpp b/src/zl-util/STLString.cpp index 5cb249aa4d..3aef785751 100644 --- a/src/zl-util/STLString.cpp +++ b/src/zl-util/STLString.cpp @@ -209,7 +209,7 @@ void STLString::write_var ( cc8* format, va_list args ) { this->append ( buffer ); if ( buffer != str ) { - free ( buffer ); + free ( str ); } }