diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2003-11-05 09:41:23 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2003-11-05 09:41:23 +0000 |
commit | bd9f52d566a4e7d4881bc8df069dec2208235917 (patch) | |
tree | 1ea09163a35ae85d875bf32809246ad32e65bf53 /lib/libipsec/policy_token.l | |
parent | 5cf7816f16062832513a199d61472e2ff8c6fd57 (diff) |
- plug memory leak.
- fixed a length of the sadb extension in the case of pfkey_send_x5().
- used getprotobynumber() for printing a upper layer protocol name.
- modified the output format against the change of the setkey syntax
about a icmp6 type/code.
- don't enumerate reserved fields. use memset.
Obtained from: KAME
Notes
Notes:
svn path=/head/; revision=122107
Diffstat (limited to 'lib/libipsec/policy_token.l')
-rw-r--r-- | lib/libipsec/policy_token.l | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/libipsec/policy_token.l b/lib/libipsec/policy_token.l index 11e0c06a330e..ced57b3fee71 100644 --- a/lib/libipsec/policy_token.l +++ b/lib/libipsec/policy_token.l @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $KAME: policy_token.l,v 1.11 2000/12/01 10:08:29 sakane Exp $ */ +/* $KAME: policy_token.l,v 1.13 2003/05/09 05:19:55 sakane Exp $ */ /* * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. @@ -46,11 +46,7 @@ #include <unistd.h> #include <errno.h> -#ifndef __NetBSD__ #include "y.tab.h" -#else -#include "policy_parse.h" -#endif #define yylval __libipsecyylval /* XXX */ int yylex(void); @@ -133,16 +129,26 @@ unique { yylval.num = IPSEC_LEVEL_UNIQUE; return(LEVEL); } %% void __policy__strbuffer__init__(char *); +void __policy__strbuffer__free__(void); + +static YY_BUFFER_STATE strbuffer; void __policy__strbuffer__init__(msg) char *msg; { - YY_BUFFER_STATE yyb; - - yyb = (YY_BUFFER_STATE)yy_scan_string(msg); - yy_switch_to_buffer(yyb); + if (yy_current_buffer) + yy_delete_buffer(yy_current_buffer); + strbuffer = (YY_BUFFER_STATE)yy_scan_string(msg); + yy_switch_to_buffer(strbuffer); return; } +void +__policy__strbuffer__free__() +{ + yy_delete_buffer(strbuffer); + + return; +} |