char *str = foo(); defer { free(str); } return strlen(str);
Right, there's a demonstration of GP's question (or a variation) on page 10 of the draft technical specification.