gtlsinteraction: Hoist precondition before allocation
authorColin Walters <walters@verbum.org>
Tue, 22 Jul 2014 18:04:44 +0000 (14:04 -0400)
committerColin Walters <walters@verbum.org>
Wed, 23 Jul 2014 17:31:02 +0000 (13:31 -0400)
commit7009e317d84f661ec63b85edb436d3a2727be488
treea3f03370d5f58010bc120a1fd0eec79af85daec3
parent627b49b39039d43a784fa9890f473d1ca8d52417
gtlsinteraction: Hoist precondition before allocation

We're using a precondition in the middle of the function, and if we
hit it, we leak the closure.

Let's allocate the closure per path; this allows us to allocate it
before path-specific preconditions, and better avoids a pointless
malloc/free pair in the unhandled case.

https://bugzilla.gnome.org/show_bug.cgi?id=733576
gio/gtlsinteraction.c