mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 18:08:23 +00:00
add cast for strdup in places it does not have it
This commit is contained in:
parent
6993389719
commit
f9b80fcad4
@ -511,7 +511,7 @@ cmndalias : ALIAS {
|
|||||||
in_alias = TRUE;
|
in_alias = TRUE;
|
||||||
/* Allocate space for ga_list if necesary. */
|
/* Allocate space for ga_list if necesary. */
|
||||||
expand_ga_list();
|
expand_ga_list();
|
||||||
if (!(ga_list[ga_list_len-1].alias = strdup($1))){
|
if (!(ga_list[ga_list_len-1].alias = (char *) strdup($1))){
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"%s: cannot allocate memory!\n", Argv[0]);
|
"%s: cannot allocate memory!\n", Argv[0]);
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -544,7 +544,7 @@ runasalias : ALIAS {
|
|||||||
in_alias = TRUE;
|
in_alias = TRUE;
|
||||||
/* Allocate space for ga_list if necesary. */
|
/* Allocate space for ga_list if necesary. */
|
||||||
expand_ga_list();
|
expand_ga_list();
|
||||||
if (!(ga_list[ga_list_len-1].alias = strdup($1))){
|
if (!(ga_list[ga_list_len-1].alias = (char *) strdup($1))){
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"%s: cannot allocate memory!\n", Argv[0]);
|
"%s: cannot allocate memory!\n", Argv[0]);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
2
sudo.c
2
sudo.c
@ -560,7 +560,7 @@ static void load_globals(sudo_mode)
|
|||||||
*/
|
*/
|
||||||
if ((p = strchr(host, '.'))) {
|
if ((p = strchr(host, '.'))) {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
if ((shost = strdup(host)) == NULL) {
|
if ((shost = (char *) strdup(host)) == NULL) {
|
||||||
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
|
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ int main(argc, argv)
|
|||||||
|
|
||||||
if ((p = strchr(host, '.'))) {
|
if ((p = strchr(host, '.'))) {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
if ((shost = strdup(host)) == NULL) {
|
if ((shost = (char *) strdup(host)) == NULL) {
|
||||||
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
|
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user