[3223] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[barnowl/barnowl] ef4074: Cleanup in owl_zwrite_create on error cases

daemon@ATHENA.MIT.EDU (noreply@github.com)
Mon Oct 3 00:34:06 2011

Date: Sun, 2 Oct 2011 21:34:04 -0700
To: barnowl-dev@mit.edu
From: noreply@github.com

  Branch: refs/heads/master
  Home:   https://github.com/barnowl/barnowl

  Commit: ef4074b758108eb46e2b1884e950d6f092a01260
      https://github.com/barnowl/barnowl/commit/ef4074b758108eb46e2b1884e950d6f092a01260
  Author: David Benjamin <davidben@mit.edu>
  Date:   2011-10-02 (Sun, 02 Oct 2011)

  Changed paths:
    M zwrite.c

  Log Message:
  -----------
  Cleanup in owl_zwrite_create on error cases

Before, the caller was required to cleanup, even on error. This is kind
of weird. In particular, owl_zwrite_create_and_send_from_line forgot to
so there was a small leak in there.

Also with 6329cd5136a27361dedf94bb92e20fa2d327e43c it's now possible to
error from owl_zwrite_create_from_line before the owl_zwrite is
initialized, which means that owl_zwrite_new_from_line on misquoted
strings explodes. Oops.  Although I don't think this is actually
possible to trigger now.

Also be consistent about whether rv != 0 or rv < 0 is the error
condition. Barring any actual arguments one or another, I'm going to
arbitrary declare it's the former since that function doesn't really
have a useful number to return.



home help back first fref pref prev next nref lref last post