Used all the time a decade or so ago when writing code that made heavy use of Apple's CoreFoundation. CF could return nil (failure) for many operations, and memory management at that time was left up to the programmer.
// Not real code, approximated from recollection
bool createNestedCFThing () {
CFDictionary *thing = nil;
CFArray *arrayObj = nil;
CFString *string1 = nil;
CFString *string0 = nil;
string0 = CFCreateString ("Hello");
if (string0 == nil) {
goto bail;
}
string1 = CFCreateString ("World");
if (string1 == nil) {
goto bail;
}
arrayObj = CFCreateArray ();
if (arrayObj == nil) {
goto bail;
}
if (CFArrayAddObject (arrayObj, string0) == false) {
goto bail;
}
if (CFArrayAddObject (arrayObj, string1) == false) {
goto bail;
}
thing = CFCreateDictionary ();
if (thing == nil) {
goto bail;
}
if (!CFDictionaryInsertObjectWithKey (thing, arrayObj, "somekey")) {
goto bail;
}
bail: if (arrayObj != nil) {
CFRelease (arrayObj);
}
if (string1 != nil) {
CFRelease (string1);
}
if (string0 != nil) {
CFRelease (string0);
}
return thing;
}