* src/css-url.c (get_urls_css): Fix memory leak

This commit is contained in:
Tim Rühsen 2016-08-17 23:13:27 +02:00
parent 964f4646da
commit 0787d7253e

View File

@ -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"));
}