]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9867 syncprov: plug findbase memleak
authorHoward Chu <hyc@openldap.org>
Thu, 16 Jun 2022 20:36:24 +0000 (21:36 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 23 Jun 2022 18:47:29 +0000 (18:47 +0000)
servers/slapd/overlays/syncprov.c

index 36978d609a3e0de51f952301b80553165da2d02f..868bb114ee9c701d73aee855f11022c0797f2b43 100644 (file)
@@ -3163,6 +3163,8 @@ syncprov_op_search( Operation *op, SlapReply *rs )
                         */
                        ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
                        if ( slapd_shutdown ) {
+aband:
+                               ch_free( sop->s_base.bv_val );
                                ch_free( sop );
                                return SLAPD_ABANDON;
                        }
@@ -3172,8 +3174,7 @@ syncprov_op_search( Operation *op, SlapReply *rs )
                }
                if ( op->o_abandon ) {
                        ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
-                       ch_free( sop );
-                       return SLAPD_ABANDON;
+                       goto aband;
                }
                ldap_pvt_thread_mutex_init( &sop->s_mutex );
                sop->s_next = si->si_ops;
@@ -3302,6 +3303,7 @@ bailout:
                                                sp = &(*sp)->s_next;
                                        *sp = sop->s_next;
                                        ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
+                                       ch_free( sop->s_base.bv_val );
                                        ch_free( sop );
                                }
                                rs->sr_ctrls = NULL;