if (sscanf(t, "%[0-9a-fA-F:]", buf) != 1) {
debugs(28, DBG_CRITICAL, "aclParseArpData: Bad ethernet address: '" << t << "'");
- safe_free(q);
+ delete q;
return NULL;
}
if (!q->decode(buf)) {
debugs(28, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line);
debugs(28, DBG_CRITICAL, "aclParseArpData: Ignoring invalid ARP acl entry: can't parse '" << buf << "'");
- safe_free(q);
+ delete q;
return NULL;
}
void
ACLARP::parse()
{
- char *t = NULL;
- Eui::Eui48 *q = NULL;
-
- while ((t = strtokFile())) {
- if ((q = aclParseArpData(t)) == NULL)
- continue;
-
- aclArpData.insert(*q);
- safe_free(q);
+ while (const char *t = strtokFile()) {
+ if (Eui::Eui48 *q = aclParseArpData(t)) {
+ aclArpData.insert(*q);
+ delete q;
+ }
}
-
}
int
if (sscanf(t, "%[0-9a-fA-F:]", buf) != 1) {
debugs(28, DBG_CRITICAL, "aclParseEuiData: Bad EUI-64 address: '" << t << "'");
- safe_free(q);
+ delete q;
return NULL;
}
if (!q->decode(buf)) {
debugs(28, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line);
debugs(28, DBG_CRITICAL, "aclParseEuiData: Ignoring invalid EUI-64 acl entry: can't parse '" << buf << "'");
- safe_free(q);
+ delete q;
return NULL;
}
while (const char * t = strtokFile()) {
if (Eui::Eui64 * q = aclParseEuiData(t)) {
eui64Data.insert(*q);
- safe_free(q);
+ delete q;
}
}
}