mirror of
https://github.com/mirror/wget.git
synced 2025-03-25 01:00:13 +08:00
* src/css-url.c (get_urls_css): Fix memory leak
This commit is contained in:
parent
964f4646da
commit
0787d7253e
@ -59,6 +59,7 @@ extern char *yytext;
|
||||
extern int yyleng;
|
||||
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
||||
extern YY_BUFFER_STATE yy_scan_bytes (const char *bytes,int len );
|
||||
extern void yy_delete_buffer (YY_BUFFER_STATE b);
|
||||
extern int yylex (void);
|
||||
|
||||
/*
|
||||
@ -109,9 +110,10 @@ get_urls_css (struct map_context *ctx, int offset, int buf_length)
|
||||
int buffer_pos = 0;
|
||||
int pos, length;
|
||||
char *uri;
|
||||
YY_BUFFER_STATE b;
|
||||
|
||||
/* tell flex to scan from this buffer */
|
||||
yy_scan_bytes (ctx->text + offset, buf_length);
|
||||
b = yy_scan_bytes (ctx->text + offset, buf_length);
|
||||
|
||||
while((token = yylex()) != CSSEOF)
|
||||
{
|
||||
@ -188,6 +190,9 @@ get_urls_css (struct map_context *ctx, int offset, int buf_length)
|
||||
}
|
||||
buffer_pos += yyleng;
|
||||
}
|
||||
|
||||
yy_delete_buffer(b);
|
||||
|
||||
DEBUGP (("\n"));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user