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#00063

freedesktop.dbus

Subject: Re: dbus_connection_send_with_reply_and_block and errors

This is a multi-part message in MIME format.ext Havoc Pennington wrote:
> Hi,
>
> Thanks, this looks good, missing a couple spaces-before-parens:

Oh yeah, forgot that. I usually code kernel style. Fixed that.

>>- _dbus_string_free (&str);
>
> Sure you should remove this?

I just moved it a bit upwards to handle propely the OOM case of
_dbus_strdup().


- Timo


Index: dbus/dbus-errors.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-errors.c,v
retrieving revision 1.27
diff -u -r1.27 dbus-errors.c
--- dbus/dbus-errors.c 10 Aug 2004 03:06:59 -0000 1.27
+++ dbus/dbus-errors.c 9 Aug 2005 18:56:18 -0000
@@ -180,7 +180,10 @@
real = (DBusRealError *)error;

if (!real->const_message)
- dbus_free (real->message);
+ {
+ dbus_free (real->name);
+ dbus_free (real->message);
+ }

dbus_error_init (error);
}
@@ -306,7 +309,7 @@
* @todo should be called dbus_error_set()
*
* @param error the error.
- * @param name the error name (not copied!!!)
+ * @param name the error name
* @param format printf-style format string.
*/
void
@@ -359,12 +362,17 @@
_dbus_string_free (&str);
goto nomem;
}
+ _dbus_string_free (&str);

- real->name = name;
+ real->name = _dbus_strdup (name);
+ if (real->name == NULL)
+ {
+ dbus_free (real->message);
+ real->message = NULL;
+ goto nomem;
+ }
real->const_message = FALSE;

- _dbus_string_free (&str);
-
return;

nomem:





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