Closed ghost closed 11 years ago
I like it, and I agree with your approach. One bug snug into it while doing the cleanup: there is a free(buf) of a file that is to be served by the webserver, that needs to go; other than that, looks ready to merge.
Very good catch. Thanks a lot. Could have become nasty to find that one.
Thanks. I personally stick to 80 characters as well, but this just fits.
Don't know if this will appeal to you, but let's give it a try.
I've pulled out the payload/paywork from the resource allocation/deallocation logic.
My personal preference (yours may be different) is to allocate required resources, call for someone else to do the real work and when I know the outcome of that, I deal with freeing resources.
If I fail to allocate the resources, I can easily bail out. If the real pay-work fails, I'll know about it and I can deal with it.
No more gotos. :-)
I think this diff is hard to read. Kinda out of sequence. You may or may not want to use your printer before deciding how to deal with my proposal.