bluetooth: Fix possible NULL pointer dereference
authorSzymon Janc <szymon.janc@tieto.com>
Thu, 28 Feb 2013 15:20:29 +0000 (16:20 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 4 Mar 2013 10:24:05 +0000 (11:24 +0100)
If DBus message allocation failed NULL pointer msg would be
passed to libdbus functions later on resulting in libdbus NULL pointer
assertion or crash.

src/bluetooth.c

index 57163aa..0207919 100644 (file)
@@ -157,7 +157,7 @@ static int bt_generic_call(DBusConnection *conn,
 
        if (msg == NULL) {
                near_error("Unable to allocate new D-Bus %s message", method);
-               err = -ENOMEM;
+               return -ENOMEM;
        }
 
        va_start(args, type);