With C++ RAII you can have a brain fart and forget about freeing a resource, but you're still OK.
This doesn't work with lexical-scope-cleanup things like golang's defer (and bugs me when new languages add it instead of destructors). Instead you either have to document that the caller has to remember to defer-cleanup the result, or you have to do funky things like take a callback that receives the value, invoke the callback and defer-cleanup the value.
What makes C++ flexible in practice is move semantics, which lets you move-return values, such that only the destructor call on the caller side is the one that matters.
Notice how I said "cleanup-via-destructor" rather than just "destructor", for this reason.
Disclaimer: Not a language lawyer, just a fan.