From de9d7e4f3ccb1b199602c1a1ce884df37e54f834 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Fri, 29 Jul 2016 15:54:03 +0000 Subject: lib: Cleanup some memory issues in CLI Various memory leaks have been fixed and the quagga memory macros are in use. Also consolidated the argv and matching code into one graph traversal. Signed-off-by: Quentin Young --- lib/command_lex.l | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/command_lex.l') diff --git a/lib/command_lex.l b/lib/command_lex.l index 45f8f8e63..5a0e76d41 100644 --- a/lib/command_lex.l +++ b/lib/command_lex.l @@ -22,14 +22,14 @@ RANGE \({NUMBER}\-{NUMBER}\) %% [ /t] /* ignore whitespace */; -{WORD} {yylval.string = strdup(yytext); return WORD;} -{IPV4} {yylval.string = strdup(yytext); return IPV4;} -{IPV4_PREFIX} {yylval.string = strdup(yytext); return IPV4_PREFIX;} -{IPV6} {yylval.string = strdup(yytext); return IPV6;} -{IPV6_PREFIX} {yylval.string = strdup(yytext); return IPV6_PREFIX;} -{VARIABLE} {yylval.string = strdup(yytext); return VARIABLE;} +{WORD} {yylval.string = XSTRDUP(MTYPE_TMP, yytext); return WORD;} +{IPV4} {yylval.string = XSTRDUP(MTYPE_TMP, yytext); return IPV4;} +{IPV4_PREFIX} {yylval.string = XSTRDUP(MTYPE_TMP, yytext); return IPV4_PREFIX;} +{IPV6} {yylval.string = XSTRDUP(MTYPE_TMP, yytext); return IPV6;} +{IPV6_PREFIX} {yylval.string = XSTRDUP(MTYPE_TMP, yytext); return IPV6_PREFIX;} +{VARIABLE} {yylval.string = XSTRDUP(MTYPE_TMP, yytext); return VARIABLE;} {NUMBER} {yylval.integer = atoi(yytext); return NUMBER;} -{RANGE} {yylval.string = strdup(yytext); return RANGE;} +{RANGE} {yylval.string = XSTRDUP(MTYPE_TMP, yytext); return RANGE;} . {return yytext[0];} %% -- cgit v1.2.3