From b05a997e2744579ca0cb141526285b5d9dee9321 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 11 Jun 2008 08:45:46 +0000 Subject: Fix use of uninitialized memory when getting local name fails --- hcid/dbus-hci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index d0b6b59c..6e4b897e 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -2278,9 +2278,7 @@ void hcid_dbus_setname_complete(bdaddr_t *local) error("Sending getting name command failed: %s (%d)", strerror(errno), errno); rp.name[0] = '\0'; - } - - if (rp.status) { + } else if (rp.status) { error("Getting name failed with status 0x%02x", rp.status); rp.name[0] = '\0'; -- cgit