If we run out of memory while setting an error, we need to recover by
setting the error to "out of memory" instead of the original error.
Otherwise, the error indicator would be unset, breaking the rules of
our error model.
Signed-off-by: Simon McVittie <smcv@collabora.com>
dbus_bool_t retval;
if (!_dbus_string_init (&str))
- goto out;
+ {
+ _DBUS_SET_OOM (error);
+ goto out;
+ }
va_start (args, format);
retval = _dbus_string_append_printf_valist (&str, format, args);
va_end (args);
if (!retval)
{
+ _DBUS_SET_OOM (error);
_dbus_string_free (&str);
goto out;
}
out:
if (message != NULL)
_dbus_win_free_error_string (message);
+
+ _DBUS_ASSERT_ERROR_IS_SET (error);
}
/**