logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: dbus_connection_send_with_reply_and_block and errors: msg#00057

freedesktop.dbus

Subject: Re: dbus_connection_send_with_reply_and_block and errors

On Tue, 2005-08-09 at 19:55 +0300, Timo Teräs wrote:
> ext Havoc Pennington wrote:
> > On Tue, 2005-08-09 at 19:02 +0300, Timo Teräs wrote:
> >>dbus_set_error() never duplicates the error.name field; it just does a
> >>pointer assignment.
> >
> > I think this is the bug (I'm not sure why it is like this to be honest,
> > seems like a pretty bad idea, though it looks like it was deliberate)
>
> I guess in most cases the error.name is a constant and can be safely
> assigned. This makes sense since it saves memory and CPU cycles. But in case
> of dbus_set_error_from_message() it is just broken.
>
> So, shall I write a patch to do duplication of .name in dbus_set_error() and
> do a free() in dbus_error_free()?

Hm...doesn't this make OOM handling significantly more complicated if
setting an error can require memory allocation?

Perhaps instead of the reference counting (which sounds complicated) we
could simply to add a "dbus_bool_t free_name" member;
dbus_set_error_from_message sets this (and dups the name), and
dbus_error_free frees the name if it's set. Wouldn't that work?


Attachment: signature.asc
Description: This is a digitally signed message part






Only community members can participate in forum threads. You must Register or log in to contribute.

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo