mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-26 06:26:41 +00:00
Multiple revisions 360356-360357
........ r360356 | russell | 2012-03-23 22:33:36 -0400 (Fri, 23 Mar 2012) | 6 lines expression parser: Fix (theoretical) memory leak. Fix a memory leak that is very unlikely to actually happen. If a malloc() succeeded, but the following strdup() failed, the memory from the original malloc() would be leaked. ........ r360357 | russell | 2012-03-23 22:34:39 -0400 (Fri, 23 Mar 2012) | 6 lines Rebuild parsers. This is needed to include the last fix to main/ast_expr2.y. The changes look much bigger as this regeneration of the code was done with newer versions of flex and bison. ........ Merged revisions 360356-360357 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 360358 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -56,6 +56,7 @@ typedef int flex_int32_t;
|
||||
typedef unsigned char flex_uint8_t;
|
||||
typedef unsigned short int flex_uint16_t;
|
||||
typedef unsigned int flex_uint32_t;
|
||||
#endif /* ! C99 */
|
||||
|
||||
/* Limits of integral types. */
|
||||
#ifndef INT8_MIN
|
||||
@@ -86,8 +87,6 @@ typedef unsigned int flex_uint32_t;
|
||||
#define UINT32_MAX (4294967295U)
|
||||
#endif
|
||||
|
||||
#endif /* ! C99 */
|
||||
|
||||
#endif /* ! FLEXINT_H */
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -161,15 +160,7 @@ typedef void* yyscan_t;
|
||||
|
||||
/* Size of default input buffer. */
|
||||
#ifndef YY_BUF_SIZE
|
||||
#ifdef __ia64__
|
||||
/* On IA-64, the buffer size is 16k, not 8k.
|
||||
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
|
||||
* Ditto for the __ia64__ case accordingly.
|
||||
*/
|
||||
#define YY_BUF_SIZE 32768
|
||||
#else
|
||||
#define YY_BUF_SIZE 16384
|
||||
#endif /* __ia64__ */
|
||||
#endif
|
||||
|
||||
/* The state buf must be large enough to hold one state per character in the main buffer.
|
||||
@@ -609,7 +600,7 @@ int ast_yyget_column(yyscan_t yyscanner);
|
||||
static int curlycount = 0;
|
||||
static char *expr2_token_subst(const char *mess);
|
||||
|
||||
#line 611 "ast_expr2f.c"
|
||||
#line 602 "ast_expr2f.c"
|
||||
|
||||
#define INITIAL 0
|
||||
#define var 1
|
||||
@@ -706,6 +697,10 @@ int ast_yyget_lineno (yyscan_t yyscanner );
|
||||
|
||||
void ast_yyset_lineno (int line_number ,yyscan_t yyscanner );
|
||||
|
||||
int ast_yyget_column (yyscan_t yyscanner );
|
||||
|
||||
void ast_yyset_column (int column_no ,yyscan_t yyscanner );
|
||||
|
||||
YYSTYPE * ast_yyget_lval (yyscan_t yyscanner );
|
||||
|
||||
void ast_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
|
||||
@@ -748,12 +743,7 @@ static int input (yyscan_t yyscanner );
|
||||
|
||||
/* Amount of stuff to slurp up with each read. */
|
||||
#ifndef YY_READ_BUF_SIZE
|
||||
#ifdef __ia64__
|
||||
/* On IA-64, the buffer size is 16k, not 8k */
|
||||
#define YY_READ_BUF_SIZE 16384
|
||||
#else
|
||||
#define YY_READ_BUF_SIZE 8192
|
||||
#endif /* __ia64__ */
|
||||
#endif
|
||||
|
||||
/* Copy whatever the last rule matched to the standard output. */
|
||||
@@ -772,7 +762,7 @@ static int input (yyscan_t yyscanner );
|
||||
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
|
||||
{ \
|
||||
int c = '*'; \
|
||||
size_t n; \
|
||||
unsigned n; \
|
||||
for ( n = 0; n < max_size && \
|
||||
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
|
||||
buf[n] = (char) c; \
|
||||
@@ -860,7 +850,7 @@ YY_DECL
|
||||
#line 130 "ast_expr2.fl"
|
||||
|
||||
|
||||
#line 862 "ast_expr2f.c"
|
||||
#line 852 "ast_expr2f.c"
|
||||
|
||||
yylval = yylval_param;
|
||||
|
||||
@@ -1206,7 +1196,7 @@ YY_RULE_SETUP
|
||||
#line 238 "ast_expr2.fl"
|
||||
ECHO;
|
||||
YY_BREAK
|
||||
#line 1208 "ast_expr2f.c"
|
||||
#line 1198 "ast_expr2f.c"
|
||||
case YY_STATE_EOF(INITIAL):
|
||||
case YY_STATE_EOF(var):
|
||||
yyterminate();
|
||||
@@ -1980,8 +1970,8 @@ YY_BUFFER_STATE ast_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
|
||||
|
||||
/** Setup the input buffer state to scan the given bytes. The next call to ast_yylex() will
|
||||
* scan from a @e copy of @a bytes.
|
||||
* @param yybytes the byte buffer to scan
|
||||
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
|
||||
* @param bytes the byte buffer to scan
|
||||
* @param len the number of bytes in the buffer pointed to by @a bytes.
|
||||
* @param yyscanner The scanner object.
|
||||
* @return the newly allocated buffer state object.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user