Browse Source
Explicitly delete the copy constructor and copy assignment operator for pipebuf, which owns a dynamically allocated buffer released by its destructor. The implicitly generated copy operations would shallow-copy the buffer pointer, leaving multiple pipebuf instances referring to the same allocation and potentially causing double deletion. Since pipebuf is not intended to be copied or assigned, prohibit both operations at compile time to prevent unsafe resource ownership. cppcheck identified the missing copy constructor and assignment operator with its noCopyConstructor and noOperatorEq warnings. Signed-off-by: Robin Getz <rgetz503@gmail.com>chirpmodem-v8.0.0
1 changed files with 3 additions and 0 deletions
Loading…
Reference in new issue