xserver: Branch 'master'
Daniel Stone
daniel at fooishbar.org
Sun Aug 16 15:57:32 PDT 2009
On Sun, Aug 16, 2009 at 06:01:49PM +0100, Daniel Stone wrote:
> On Thu, Aug 13, 2009 at 06:02:13PM -0700, Peter Hutterer wrote:
> > out_ctx:
> > dbus_error_free(&error);
> ^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > - if (info->hal_ctx) {
> > - if (!libhal_ctx_shutdown(info->hal_ctx, &error)) {
> > - LogMessage(X_WARNING, "config/hal: couldn't shut down context: %s (%s)\n",
> > - error.name ? error.name : "unknown error",
> > - error.message ? error.message : "null");
> > - dbus_error_free(&error);
> > - }
> > - libhal_ctx_free(info->hal_ctx);
> > + if (!libhal_ctx_shutdown(info->hal_ctx, &error)) {
> > + LogMessage(X_WARNING, "config/hal: couldn't shut down context: %s (%s)\n",
> > + error.name ? error.name : "unknown error",
> > + error.message ? error.message : "null");
> > + dbus_error_free(&error);
^^^^^^^^^^^^^^^^^^^^^^^^
And a secret bonus third one. ;)
> > }
> >
> > out_err:
> > dbus_error_free(&error);
> ^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > + if (info->hal_ctx) {
> > + libhal_ctx_free(info->hal_ctx);
> > + }
> > +
> > info->hal_ctx = NULL;
> > info->system_bus = NULL;
>
> That's going to end in tears. There's no need to free it at the top of
> out_ctx, and indeed it means, if anything, that you really don't want to
> be passing it into libhal_ctx_shutdown.
>
> Cheers,
> Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20090816/b0a74164/attachment.pgp
More information about the xorg-devel
mailing list