here appears to be the best way to go, resulting in the cleanest and most efficient code of all possibilities, or at least so it seems to me. Quoting Steve McConnell in Code Complete:

The goto is useful in a routine that
allocates resources, performs
operations on those resources, and
then deallocates the resources. With a
goto, you can clean up in one section
of the code. The goto reduces the
likelihood of your forgetting to
deallocate the resources in each place
you detect an error.

Another support for this approach comes from the Linux Device Drivers book, in this section.

What do you think? Is this case a valid use for

goto

in C? Would you prefer other methods, which produce more convoluted and/or less efficient code, but avoid

FWIF, I find the error handling idiom you gave in the question's example to be more readable and easier to understand than any of the alternatives given in the answers so far. While goto is a bad idea in general, it can be useful for error handling when done in a simple and uniform manner. In this situation, even though it's a goto, it's being used in well-defined and more or less structured manner.