In Windows _dbus_printf_string_upper_bound, don't crash on malloc failure

This commit is contained in:
Simon McVittie 2011-06-21 14:09:52 +01:00 committed by Ralf Habacker
parent 110e06a78c
commit 7b63fe3cfa

View file

@ -549,6 +549,10 @@ int _dbus_printf_string_upper_bound (const char *format,
bufsize *= 2;
p = malloc (bufsize);
if (p == NULL)
return -1;
len = _vsnprintf (p, bufsize - 1, format, args);
free (p);
}