On Tue, 24 Nov 2009 16:22:02 +0200, Dirk-Jan C. Binnema <djcb.b...@gmail.com> 
wrote:
> 
> Another minor patch, fixing a couple of resource leaks in error paths.

Thanks, Dirk-Jan, but we don't actually need this kind of care in some
cases, because these aren't leaks in a permanent sense since they are
talloc-based. Instead these "leaks" simply mean that on the error paths
these objects will live slightly longer than normal, until the caller
frees the talloc context.

And I'm perfectly happy to have slightly longer-lived objects in the
error paths, (while still guaranteeing leak-free behavior in all
cases). And I definitely like the easier-to-read-and-verify code that
comes with the early return values.

Now, we do have to be careful if there are side effects from having an
object live longer, (such as holding a database write lock or
something). So if there's a fix for something like that in an error
path, then yes, we'll definitely want that.

-Carl
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to