]> 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)
committerHoward Chu <hyc@openldap.org>
Thu, 16 Jun 2022 20:36:24 +0000 (21:36 +0100)
servers/slapd/overlays/syncprov.c

index d1d3b1c104bc65d9b13ce3419c5366fbc0911d97..499988662bf5dfdd64f58b602e64402fffa35bab 100644 (file)
@@ -3155,6 +3155,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;
                        }
@@ -3164,8 +3166,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;
@@ -3294,6 +3295,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;