Correct function names that failed in error messages

It should be calloc/strdup, not malloc

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2016-05-15 00:24:21 +00:00
parent a7ff045627
commit 229bb4daa1
2 changed files with 4 additions and 4 deletions

View File

@ -269,12 +269,12 @@ enum_pair_insert(struct enum_pairs *headp, int32_t enum_val, char *enum_str)
struct enum_pair *e_new;
if ((e_new = calloc(1, sizeof(struct enum_pair))) == NULL) {
syslog(LOG_ERR, "malloc() failed: %s", strerror(errno));
syslog(LOG_ERR, "calloc() failed: %s", strerror(errno));
return (-1);
}
if ((e_new->enum_str = strdup(enum_str)) == NULL) {
syslog(LOG_ERR, "malloc() failed: %s", strerror(errno));
syslog(LOG_ERR, "strdup() failed: %s", strerror(errno));
free(e_new);
return (-1);
}

View File

@ -252,12 +252,12 @@ add_filename(struct snmp_toolinfo *snmptoolctx, const char *filename,
}
if ((fstring = strdup(filename)) == NULL) {
warnx("malloc() failed - %s", strerror(errno));
warnx("strdup() failed - %s", strerror(errno));
return (-1);
}
if ((entry = calloc(1, sizeof(struct fname))) == NULL) {
warnx("malloc() failed - %s", strerror(errno));
warnx("calloc() failed - %s", strerror(errno));
free(fstring);
return (-1);
}