From 11585f79a9aebf19bfe837b000d93cff2f08db14 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 27 Aug 2006 11:53:19 +0000 Subject: Fix memory leaks in the config file parser --- hcid/parser.y | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'hcid/parser.y') 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; } -- cgit