diff options
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | dbus/dbus-errors.c | 18 | 
2 files changed, 18 insertions, 5 deletions
@@ -1,5 +1,10 @@  2005-08-09  Havoc Pennington  <hp@redhat.com> +	* dbus/dbus-errors.c: apply patch from Timo Teras to make a +	malloc'd copy of the name parameter + +2005-08-09  Havoc Pennington  <hp@redhat.com> +  	* dbus/dbus-message.c (dbus_message_set_reply_serial): print  	warning if the reply serial is set to 0 diff --git a/dbus/dbus-errors.c b/dbus/dbus-errors.c index 287b4d79..d37c0688 100644 --- a/dbus/dbus-errors.c +++ b/dbus/dbus-errors.c @@ -180,7 +180,10 @@ dbus_error_free (DBusError *error)    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 @@ dbus_error_is_set (const DBusError *error)   * @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_set_error (DBusError  *error,        _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:  | 
