void FunctionWithoutLeaks (void) { // All strings must be allocated using specific functions String_var vSmartPointer = string_dup ("A string ..."); // Except assignment from const string which copies const char *pConstPointer = "A const string ..."; vSmartPointer = pConstPointer; // Assignment releases rather than overwrites vSmartPointer = string_dup ("Another string ..."); // Going out of scope releases too throw (0); }