Handle failure to allocate error message in _read_subprocess_line_argv
authorChristian Dywan <christian.dywan@lanedo.com>
Mon, 19 Jul 2010 09:36:15 +0000 (11:36 +0200)
committerSimon McVittie <smcv@debian.org>
Wed, 5 Jan 2011 14:47:12 +0000 (14:47 +0000)
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29881

dbus/dbus-sysdeps-unix.c

index 7c55757..20700ae 100644 (file)
@@ -3188,7 +3188,12 @@ _read_subprocess_line_argv (const char *progpath,
     {
       /* The process ended with error */
       DBusString error_message;
-      _dbus_string_init (&error_message);
+      if (!_dbus_string_init (&error_message))
+        {
+          _DBUS_SET_OOM (error);
+          goto out;
+        }
+
       ret = 0;
       do
         {