while ((stacksize += STACKINCREMENT) < top); \
match = (struct matchstack *) realloc(match, sizeof(struct matchstack) * stacksize); \
if (match == NULL) { \
- perror("malloc"); \
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]); \
exit(1); \
} \
/* Allocate space for ga_list if necesary. */
expand_ga_list();
if (!(ga_list[ga_list_len-1].alias = strdup($1))){
- perror("malloc");
(void) fprintf(stderr,
"%s: cannot allocate memory!\n", Argv[0]);
exit(1);
/* Allocate space for ga_list if necesary. */
expand_ga_list();
if (!(ga_list[ga_list_len-1].alias = strdup($1))){
- perror("malloc");
(void) fprintf(stderr,
"%s: cannot allocate memory!\n", Argv[0]);
exit(1);
/* Assumes dst will be NULL if not set. */
if (dst == NULL) {
if ((dst = (char *) malloc(BUFSIZ)) == NULL) {
- perror("malloc");
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
exit(1);
}
*dst_size += BUFSIZ;
if (!(dst = (char *) realloc(dst, *dst_size))) {
- perror("malloc");
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
exit(1);
}
if (ga_list == NULL) {
if ((ga_list = (struct generic_alias *)
malloc(sizeof(struct generic_alias) * ga_list_size)) == NULL) {
- perror("malloc");
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
exit(1);
}
} else {
if ((ga_list = (struct generic_alias *) realloc(ga_list,
sizeof(struct generic_alias) * ga_list_size)) == NULL) {
- perror("malloc");
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
exit(1);
}
if (cm_list == NULL) {
if ((cm_list = (struct command_match *)
malloc(sizeof(struct command_match) * cm_list_size)) == NULL) {
- perror("malloc");
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
exit(1);
}
} else {
if ((cm_list = (struct command_match *) realloc(cm_list,
sizeof(struct command_match) * cm_list_size)) == NULL) {
- perror("malloc");
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
exit(1);
}
stacksize = STACKINCREMENT;
match = (struct matchstack *) malloc(sizeof(struct matchstack) * stacksize);
if (match == NULL) {
- perror("malloc");
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
exit(1);
}