Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 394 Bytes

mallocOnClassError.md

File metadata and controls

11 lines (6 loc) · 394 Bytes

Pattern: Class instance allocated with malloc()

Issue: -

Description

Memory for class instance allocated with malloc(), but class contains std::string. This is unsafe, since no constructor is called and class members remain uninitialized. Consider using new instead.

Further Reading