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
pgpNdtQ5FV4kM.pgp
Description: PGP signature
_______________________________________________ xorg-devel mailing list [email protected] http://lists.x.org/mailman/listinfo/xorg-devel
