[daemon-fix] fixed querying about name information
[platform/upstream/dbus.git] / dbus / dbus-uuidgen.c
index 0d1f28c..6d7c0ae 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- mode: C; c-file-style: "gnu" -*- */
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /* dbus-uuidgen.c  The guts of the dbus-uuidgen binary live in libdbus, in this file.
  *
  * Copyright (C) 2006  Red Hat, Inc.
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
+#include <config.h>
 #include "dbus-uuidgen.h"
 #include "dbus-internals.h"
 #include "dbus-string.h"
@@ -48,7 +49,13 @@ return_uuid (DBusGUID   *uuid,
   if (uuid_p)
     {
       DBusString encoded;
-      _dbus_string_init (&encoded);
+
+      if (!_dbus_string_init (&encoded))
+        {
+          _DBUS_SET_OOM (error);
+          return FALSE;
+        }
+
       if (!_dbus_uuid_encode (uuid, &encoded) ||
           !_dbus_string_steal_data (&encoded, uuid_p))
         {