diff --git a/src/util-io.c b/src/util-io.c index ad5b82a..731a18f 100644 --- a/src/util-io.c +++ b/src/util-io.c @@ -54,7 +54,7 @@ xread_with_fds(int fd, void *buf, size_t count, int **fds) if (received > 0) { *fds = NULL; - _cleanup_free_ int *fd_return = calloc(MAX_FDS + 1, sizeof(int)); + _cleanup_free_ int *fd_return = xalloc(MAX_FDS + 1 * sizeof(int)); size_t idx = 0; for (struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg); hdr; hdr = CMSG_NXTHDR(&msg, hdr)) { diff --git a/src/util-strings.c b/src/util-strings.c index d013717..587e03e 100644 --- a/src/util-strings.c +++ b/src/util-strings.c @@ -182,7 +182,7 @@ strreplace(const char *string, const char *separator, const char *replacement) size_t rlen = strlen(replacement); size_t max = slen * max(rlen, 1); - char *r = calloc(max + 1, 1); /* the result, one extra for terminating \0 */ + char *r = xalloc(max + 1); /* the result, one extra for terminating \0 */ char *destptr = r; while (next) {