summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Krasnyansky <maxk@qualcomm.com>2002-03-26 19:25:05 +0000
committerMax Krasnyansky <maxk@qualcomm.com>2002-03-26 19:25:05 +0000
commitb442a036129e5bfe44eb95ef036bdb13f2eba009 (patch)
tree6063dd95fb577df1053b45199f7af77b68e0f361
parent1247cae735e039a593f42ce9867f8cf8e68effee (diff)
Check for null string in strtobit.
-rw-r--r--src/hci.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/hci.c b/src/hci.c
index fb7a2780..544607b9 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -74,8 +74,7 @@ static int hci_str2bit(hci_map *map, char *str, unsigned int *val)
hci_map *m;
int set;
- str = ptr = strdup(str);
- if (!str)
+ if (!str || !(str = ptr = strdup(str)))
return 0;
*val = set = 0;