mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 06:15:55 +00:00
Dereference unused expression structs when parse fails.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: parse.c,v 1.47 1999/10/19 15:26:50 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: parse.c,v 1.48 1999/10/20 16:43:35 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
@@ -2184,6 +2184,8 @@ int parse_non_binary (expr, cfile, lose, context)
|
||||
if (token != COMMA) {
|
||||
parse_warn (cfile, "comma expected.");
|
||||
*lose = 1;
|
||||
expression_dereference
|
||||
(expr, "parse_expression: EXTRACT_INT");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2191,6 +2193,8 @@ int parse_non_binary (expr, cfile, lose, context)
|
||||
if (token != NUMBER) {
|
||||
parse_warn (cfile, "number expected.");
|
||||
*lose = 1;
|
||||
expression_dereference
|
||||
(expr, "parse_expression: EXTRACT_INT");
|
||||
return 0;
|
||||
}
|
||||
switch (atoi (val)) {
|
||||
@@ -2220,6 +2224,8 @@ int parse_non_binary (expr, cfile, lose, context)
|
||||
if (token != RPAREN) {
|
||||
parse_warn (cfile, "right parenthesis expected.");
|
||||
*lose = 1;
|
||||
expression_dereference
|
||||
(expr, "parse_expression: EXTRACT_INT");
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
@@ -2251,6 +2257,8 @@ int parse_non_binary (expr, cfile, lose, context)
|
||||
if (token != COMMA) {
|
||||
parse_warn (cfile, "comma expected.");
|
||||
*lose = 1;
|
||||
expression_dereference
|
||||
(expr, "parse_expression: ENCODE_INT");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2258,6 +2266,8 @@ int parse_non_binary (expr, cfile, lose, context)
|
||||
if (token != NUMBER) {
|
||||
parse_warn (cfile, "number expected.");
|
||||
*lose = 1;
|
||||
expression_dereference
|
||||
(expr, "parse_expression: ENCODE_INT");
|
||||
return 0;
|
||||
}
|
||||
switch (atoi (val)) {
|
||||
@@ -2287,6 +2297,8 @@ int parse_non_binary (expr, cfile, lose, context)
|
||||
if (token != RPAREN) {
|
||||
parse_warn (cfile, "right parenthesis expected.");
|
||||
*lose = 1;
|
||||
expression_dereference
|
||||
(expr, "parse_expression: ENCODE_INT");
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
@@ -2598,8 +2610,11 @@ int parse_option_token (rv, cfile, fmt, expr, uniform, lookups)
|
||||
if (token == NUMBER_OR_NAME || token == NUMBER) {
|
||||
if (!expression_allocate (&t, "parse_option_token"))
|
||||
return 0;
|
||||
if (!parse_cshl (&t -> data.const_data, cfile))
|
||||
if (!parse_cshl (&t -> data.const_data, cfile)) {
|
||||
return 0;
|
||||
expression_dereference
|
||||
(&t, "parse_option_token: X");
|
||||
}
|
||||
t -> op = expr_const_data;
|
||||
} else if (token == STRING) {
|
||||
token = next_token (&val, cfile);
|
||||
|
Reference in New Issue
Block a user