diff --git a/lib/plist.c b/lib/plist.c index b447bda2..5c8e71a2 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -103,7 +103,7 @@ xbps_array_foreach_cb_multi(struct xbps_handle *xhp, struct thread_data *thd; unsigned int arraycount, slicecount; int rv = 0, maxthreads; - unsigned int reserved = 0; + unsigned int reserved; pthread_spinlock_t reserved_lock; assert(fn != NULL); @@ -138,6 +138,8 @@ xbps_array_foreach_cb_multi(struct xbps_handle *xhp, } } + reserved = slicecount * maxthreads; + for (int i = 0; i < maxthreads; i++) { thd[i].array = array; thd[i].dict = dict;