summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-06-21 13:09:52 (GMT)
committerRalf Habacker <ralf.habacker@freenet.de>2011-07-03 04:36:07 (GMT)
commite7bd2bb8487368ec61cc4c52517d806a2a51e2d4 (patch)
tree5d2636f59e94d6ff0f19ca59437e2532ad0760d9
parent84b03cae585274bfe54e2a234dff72469cef581d (diff)
downloaddbus-e7bd2bb8487368ec61cc4c52517d806a2a51e2d4.tar.gz
dbus-e7bd2bb8487368ec61cc4c52517d806a2a51e2d4.tar.xz
In Windows _dbus_printf_string_upper_bound, don't crash on malloc failure
-rw-r--r--dbus/dbus-sysdeps-win.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index 7b03c3d..f9afada 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -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);
}