diff --git a/cmod/include/nvhls_array.h b/cmod/include/nvhls_array.h index bc3bb09c..730ca926 100644 --- a/cmod/include/nvhls_array.h +++ b/cmod/include/nvhls_array.h @@ -44,8 +44,9 @@ static const char* make_permanent(const char* s) { #ifdef __SYNTHESIS__ return s; #else - std::string* str = new std::string(s); // this is an intentional memory leak.. - return str->c_str(); + static std::vector vec_str; + vec_str.push_back(std::string(s)); + return vec_str.back().c_str(); #endif }