hfp_hf_bluez5: Be more pedantic in get_version

If no 'Version' key is found we might be assigning an uninitialized
value.  Return an error in this case as the 'Version' key is required.
This commit is contained in:
Denis Kenzior 2013-10-01 11:35:27 -05:00
parent c49ed15a8f
commit 2158249069
1 changed files with 6 additions and 5 deletions

View File

@ -449,13 +449,14 @@ static int get_version(DBusMessageIter *iter, uint16_t *version)
dbus_message_iter_recurse(&entry, &valiter);
dbus_message_iter_get_basic(&valiter, &value);
break;
if (version)
*version = value;
return 0;
}
if (version)
*version = value;
return 0;
return -ENOENT;
}
static DBusMessage *profile_new_connection(DBusConnection *conn,