aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Certner <olce@FreeBSD.org>2024-01-04 15:20:50 +0000
committerOlivier Certner <olce@FreeBSD.org>2024-01-09 13:29:26 +0000
commit15bb0300eeca233827a6a13cd2ed883e0034979d (patch)
tree5365866e7b574ae044334970950ea973c34b99db
parent4d312aa051414ad77d3515f258230d01ad11d6dc (diff)
downloadsrc-15bb0300eeca233827a6a13cd2ed883e0034979d.tar.gz
src-15bb0300eeca233827a6a13cd2ed883e0034979d.zip
libhtr: pthread_attr_setaffinity_np(): Replace calloc() with malloc()
Using calloc() instead of malloc() is useless here since the allocated memory is to be wholly crushed by the memcpy() call that follows. Suggested by: kib Reviewed by: emaste, kib Approved by: emaste (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43328
-rw-r--r--lib/libthr/thread/thr_attr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_attr.c b/lib/libthr/thread/thr_attr.c
index bbb143da1a7d..561037fa5eb4 100644
--- a/lib/libthr/thread/thr_attr.c
+++ b/lib/libthr/thread/thr_attr.c
@@ -551,7 +551,7 @@ _pthread_attr_setaffinity_np(pthread_attr_t *pattr, size_t cpusetsize,
return (EINVAL);
}
if (attr->cpuset == NULL) {
- attr->cpuset = calloc(1, kern_size);
+ attr->cpuset = malloc(kern_size);
if (attr->cpuset == NULL)
return (errno);
attr->cpusetsize = kern_size;