summaryrefslogtreecommitdiffstats
path: root/hcid/parser.y
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-08-27 11:53:19 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-08-27 11:53:19 +0000
commit11585f79a9aebf19bfe837b000d93cff2f08db14 (patch)
tree05b3b23dca5633999096d675002aed53543b9904 /hcid/parser.y
parent2f1fece0402ce32292bc17dae43e3becbd19683f (diff)
Fix memory leaks in the config file parser
Diffstat (limited to 'hcid/parser.y')
-rw-r--r--hcid/parser.y12
1 files changed, 8 insertions, 4 deletions
diff --git a/hcid/parser.y b/hcid/parser.y
index aae915e9..cf947fbf 100644
--- a/hcid/parser.y
+++ b/hcid/parser.y
@@ -50,6 +50,8 @@ int yyparse(void);
int yylex(void);
int yyerror(char *s);
+void yylex_destroy(void);
+
%}
%union {
@@ -221,23 +223,23 @@ device_opt:
dev_name:
WORD {
- $$ = strdup($1);
+ $$ = $1;
}
| STRING {
- $$ = strdup($1);
+ $$ = $1;
}
;
hci:
HCI {
- $$ = strdup($1);
+ $$ = $1;
}
;
bdaddr:
BDADDR {
- $$ = strdup($1);
+ $$ = $1;
}
;
@@ -329,5 +331,7 @@ int read_config(char *file)
fclose(yyin);
+ yylex_destroy();
+
return 0;
}