path = n + 1;
} while (n);
- (void) free(origpath);
+ free(origpath);
/*
* Check current dir if dot was in the PATH
#else
if (ioctl(sock, SIOCGIFCONF, (caddr_t) ifconf) < 0) {
#endif /* _ISC */
- (void) free(ifconf_buf);
+ free(ifconf_buf);
(void) close(sock);
return;
}
interfaces = (struct interface *) erealloc(interfaces,
sizeof(struct interface) * num_interfaces);
else
- (void) free(interfaces);
+ free(interfaces);
}
- (void) free(ifconf_buf);
+ free(ifconf_buf);
(void) close(sock);
}
;
if ((p = (char *) realloc(yylval.command.args, arg_size)) == NULL) {
- (void) free(yylval.command.args);
+ free(yylval.command.args);
yyerror("unable to allocate memory");
} else
yylval.command.args = p;
if (domain == (char *) -1) {
domain = (char *) emalloc(MAXHOSTNAMELEN);
if (getdomainname(domain, MAXHOSTNAMELEN) == -1 || *domain == '\0') {
- (void) free(domain);
+ free(domain);
domain = NULL;
}
}
;
if ((p = (char *) realloc(yylval.command.args, arg_size)) == NULL) {
- (void) free(yylval.command.args);
+ free(yylval.command.args);
yyerror("unable to allocate memory");
} else
yylval.command.args = p;
| NTWKADDR {
if (addr_matches($1))
host_matches = TRUE;
- (void) free($1);
+ free($1);
}
| NETGROUP {
if (netgr_matches($1, host, NULL))
host_matches = TRUE;
- (void) free($1);
+ free($1);
}
| NAME {
if (strcasecmp(shost, $1) == 0)
host_matches = TRUE;
- (void) free($1);
+ free($1);
}
| FQHOST {
if (strcasecmp(host, $1) == 0)
host_matches = TRUE;
- (void) free($1);
+ free($1);
}
| ALIAS {
/* could be an all-caps hostname */
if (find_alias($1, HOST_ALIAS) == TRUE ||
strcasecmp(shost, $1) == 0)
host_matches = TRUE;
- (void) free($1);
+ free($1);
}
;
append($1, &cm_list[cm_list_len].runas,
&cm_list[cm_list_len].runas_len,
&cm_list[cm_list_len].runas_size, 0);
- (void) free($1);
+ free($1);
}
| USERGROUP {
runas_matches = usergr_matches($1, runas_user);
&cm_list[cm_list_len].runas_len,
&cm_list[cm_list_len].runas_size, 0);
}
- (void) free($1);
+ free($1);
}
| NETGROUP {
runas_matches = netgr_matches($1, NULL, runas_user);
&cm_list[cm_list_len].runas_len,
&cm_list[cm_list_len].runas_size, 0);
}
- (void) free($1);
+ free($1);
}
| ALIAS {
/* could be an all-caps username */
append($1, &cm_list[cm_list_len].runas,
&cm_list[cm_list_len].runas_len,
&cm_list[cm_list_len].runas_size, 0);
- (void) free($1);
+ free($1);
}
| ALL {
runas_matches = TRUE;
cmnd_matches = TRUE;
$$ = TRUE;
}
- (void) free($1);
+ free($1);
}
| COMMAND {
if (printmatches == TRUE && in_alias == TRUE) {
$$ = TRUE;
}
- (void) free($1.cmnd);
+ free($1.cmnd);
if ($1.args)
- (void) free($1.args);
+ free($1.args);
}
;
add_alias($1, CMND_ALIAS) == FALSE)
YYERROR;
pop;
- (void) free($1);
+ free($1);
if (printmatches == TRUE)
in_alias = FALSE;
add_alias($1, RUNAS_ALIAS) == FALSE)
YYERROR;
pop;
- (void) free($1);
+ free($1);
if (printmatches == TRUE)
in_alias = FALSE;
add_alias($1, USER_ALIAS) == FALSE)
YYERROR;
pop;
- (void) free($1);
+ free($1);
}
;
user : NAME {
if (strcmp($1, user_name) == 0)
user_matches = TRUE;
- (void) free($1);
+ free($1);
}
| USERGROUP {
if (usergr_matches($1, user_name))
user_matches = TRUE;
- (void) free($1);
+ free($1);
}
| NETGROUP {
if (netgr_matches($1, NULL, user_name))
user_matches = TRUE;
- (void) free($1);
+ free($1);
}
| ALIAS {
/* could be an all-caps username */
if (find_alias($1, USER_ALIAS) == TRUE ||
strcmp($1, user_name) == 0)
user_matches = TRUE;
- (void) free($1);
+ free($1);
}
| ALL {
user_matches = TRUE;
/* Be nice and free up space now that we are done. */
for (i = 0; i < ga_list_len; i++) {
- (void) free(ga_list[i].alias);
- (void) free(ga_list[i].entries);
+ free(ga_list[i].alias);
+ free(ga_list[i].entries);
}
- (void) free(ga_list);
+ free(ga_list);
ga_list = NULL;
for (i = 0; i < cm_list_len; i++) {
- (void) free(cm_list[i].runas);
- (void) free(cm_list[i].cmnd);
+ free(cm_list[i].runas);
+ free(cm_list[i].cmnd);
}
- (void) free(cm_list);
+ free(cm_list);
cm_list = NULL;
cm_list_len = 0;
cm_list_size = 0;
void reset_aliases()
{
if (aliases) {
- (void) free(aliases);
+ free(aliases);
aliases = NULL;
}
naliases = nslots = 0;
{
/* Free up old data structures if we run the parser more than once. */
if (match) {
- (void) free(match);
+ free(match);
match = NULL;
top = 0;
parse_error = FALSE;
exit(1);
}
if (NewArgc > 1)
- (void) free(buf);
+ free(buf);
/* grab a pointer to the flat arg string from the environment */
if (NewArgc > 1 && (cmnd_args = getenv("SUDO_COMMAND"))) {
/* Be nice and free up space now that we are done. */
for (i = 0; i < ga_list_len; i++) {
- (void) free(ga_list[i].alias);
- (void) free(ga_list[i].entries);
+ free(ga_list[i].alias);
+ free(ga_list[i].entries);
}
- (void) free(ga_list);
+ free(ga_list);
ga_list = NULL;
for (i = 0; i < cm_list_len; i++) {
- (void) free(cm_list[i].runas);
- (void) free(cm_list[i].cmnd);
+ free(cm_list[i].runas);
+ free(cm_list[i].cmnd);
}
- (void) free(cm_list);
+ free(cm_list);
cm_list = NULL;
cm_list_len = 0;
cm_list_size = 0;
void reset_aliases()
{
if (aliases) {
- (void) free(aliases);
+ free(aliases);
aliases = NULL;
}
naliases = nslots = 0;
{
/* Free up old data structures if we run the parser more than once. */
if (match) {
- (void) free(match);
+ free(match);
match = NULL;
top = 0;
parse_error = FALSE;
{
if (addr_matches(yyvsp[0].string))
host_matches = TRUE;
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 19:
{
if (netgr_matches(yyvsp[0].string, host, NULL))
host_matches = TRUE;
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 20:
{
if (strcasecmp(shost, yyvsp[0].string) == 0)
host_matches = TRUE;
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 21:
{
if (strcasecmp(host, yyvsp[0].string) == 0)
host_matches = TRUE;
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 22:
if (find_alias(yyvsp[0].string, HOST_ALIAS) == TRUE ||
strcasecmp(shost, yyvsp[0].string) == 0)
host_matches = TRUE;
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 25:
append(yyvsp[0].string, &cm_list[cm_list_len].runas,
&cm_list[cm_list_len].runas_len,
&cm_list[cm_list_len].runas_size, 0);
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 37:
&cm_list[cm_list_len].runas_len,
&cm_list[cm_list_len].runas_size, 0);
}
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 38:
&cm_list[cm_list_len].runas_len,
&cm_list[cm_list_len].runas_size, 0);
}
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 39:
append(yyvsp[0].string, &cm_list[cm_list_len].runas,
&cm_list[cm_list_len].runas_len,
&cm_list[cm_list_len].runas_size, 0);
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 40:
cmnd_matches = TRUE;
yyval.BOOLEAN = TRUE;
}
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 46:
yyval.BOOLEAN = TRUE;
}
- (void) free(yyvsp[0].command.cmnd);
+ free(yyvsp[0].command.cmnd);
if (yyvsp[0].command.args)
- (void) free(yyvsp[0].command.args);
+ free(yyvsp[0].command.args);
}
break;
case 49:
add_alias(yyvsp[-3].string, CMND_ALIAS) == FALSE)
YYERROR;
pop;
- (void) free(yyvsp[-3].string);
+ free(yyvsp[-3].string);
if (printmatches == TRUE)
in_alias = FALSE;
add_alias(yyvsp[-3].string, RUNAS_ALIAS) == FALSE)
YYERROR;
pop;
- (void) free(yyvsp[-3].string);
+ free(yyvsp[-3].string);
if (printmatches == TRUE)
in_alias = FALSE;
add_alias(yyvsp[-3].string, USER_ALIAS) == FALSE)
YYERROR;
pop;
- (void) free(yyvsp[-3].string);
+ free(yyvsp[-3].string);
}
break;
case 67:
{
if (strcmp(yyvsp[0].string, user_name) == 0)
user_matches = TRUE;
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 73:
{
if (usergr_matches(yyvsp[0].string, user_name))
user_matches = TRUE;
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 74:
{
if (netgr_matches(yyvsp[0].string, NULL, user_name))
user_matches = TRUE;
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 75:
if (find_alias(yyvsp[0].string, USER_ALIAS) == TRUE ||
strcmp(yyvsp[0].string, user_name) == 0)
user_matches = TRUE;
- (void) free(yyvsp[0].string);
+ free(yyvsp[0].string);
}
break;
case 76:
domain = (char *) emalloc(MAXHOSTNAMELEN);
if (getdomainname(domain, MAXHOSTNAMELEN) != 0 || *domain == '\0') {
- (void) free(domain);
+ free(domain);
domain = NULL;
}
}
if (buf[n - 1] == '\n')
buf[n - 1] = '\0';
}
- (void) free(readfds);
+ free(readfds);
} else {
buf[0] = '\0';
if (fgets(buf, sizeof(buf), input)) {
Argv[0], tmpbuf, sudoers);
Exit(-1);
}
- (void) free(tmpbuf);
+ free(tmpbuf);
} else {
(void) fprintf(stderr, "%s: Error renaming %s, %s unchanged: ",
Argv[0], stmp, sudoers);