mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
don't risk dangling pointers
This commit is contained in:
parent
d1e00eef03
commit
517ae66152
@ -124,14 +124,22 @@ do_abandon(
|
|||||||
sendabandon = 1;
|
sendabandon = 1;
|
||||||
|
|
||||||
/* find the request that we are abandoning */
|
/* find the request that we are abandoning */
|
||||||
for ( lr = ld->ld_requests; lr != NULL; lr = lr->lr_next ) {
|
start_again:;
|
||||||
|
lr = ld->ld_requests;
|
||||||
|
while ( lr != NULL ) {
|
||||||
if ( lr->lr_msgid == msgid ) { /* this message */
|
if ( lr->lr_msgid == msgid ) { /* this message */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( lr->lr_origid == msgid ) {/* child: abandon it */
|
if ( lr->lr_origid == msgid ) {/* child: abandon it */
|
||||||
(void) do_abandon( ld,
|
(void)do_abandon( ld,
|
||||||
lr->lr_origid, lr->lr_msgid, sctrls, cctrls );
|
lr->lr_origid, lr->lr_msgid, sctrls, cctrls );
|
||||||
|
|
||||||
|
/* restart, as lr may now be dangling... */
|
||||||
|
goto start_again;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lr = lr->lr_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( lr != NULL ) {
|
if ( lr != NULL ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user