]> git.sur5r.net Git - openldap/commitdiff
Fix uninit'd poolqs in prev commit
authorHoward Chu <hyc@openldap.org>
Wed, 4 Sep 2013 00:29:32 +0000 (17:29 -0700)
committerHoward Chu <hyc@openldap.org>
Wed, 4 Sep 2013 00:29:32 +0000 (17:29 -0700)
libraries/libldap_r/tpool.c

index 87fc0b3187e4f36427b614b40c3df5a9c39f128f..5d67dd9bf84f112c2a63380e11849bbe62cdec52 100644 (file)
@@ -248,7 +248,7 @@ ldap_pvt_thread_pool_init_q (
        }
 
        for (i=0; i<numqs; i++) {
-               char *ptr = LDAP_MALLOC(sizeof(struct ldap_int_thread_poolq_s) + CACHELINE-1);
+               char *ptr = LDAP_CALLOC(1, sizeof(struct ldap_int_thread_poolq_s) + CACHELINE-1);
                if (ptr == NULL) {
                        for (--i; i>=0; i--)
                                LDAP_FREE(pool->ltp_wqs[i]->ltp_free);
@@ -534,7 +534,7 @@ ldap_pvt_thread_pool_queues(
                        return(-1);
                pool->ltp_wqs = wqs;
                for (i=pool->ltp_numqs; i<numqs; i++) {
-                       char *ptr = LDAP_MALLOC(sizeof(struct ldap_int_thread_poolq_s) + CACHELINE-1);
+                       char *ptr = LDAP_CALLOC(1, sizeof(struct ldap_int_thread_poolq_s) + CACHELINE-1);
                        if (ptr == NULL) {
                                for (; i<numqs; i++)
                                        pool->ltp_wqs[i] = NULL;