From f82ca15a1862749e13a989599d7f4c52c7648957 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 4 Dec 2017 15:59:33 +0000 Subject: [PATCH] ITS#8782 plug memleaks in cancel --- libraries/libldap/cancel.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/libldap/cancel.c b/libraries/libldap/cancel.c index b09f6f021e..f3677b13a4 100644 --- a/libraries/libldap/cancel.c +++ b/libraries/libldap/cancel.c @@ -42,14 +42,14 @@ ldap_cancel( int *msgidp ) { BerElement *cancelidber = NULL; - struct berval *cancelidvalp = NULL; + struct berval cancelidvalp = { 0, NULL }; int rc; cancelidber = ber_alloc_t( LBER_USE_DER ); ber_printf( cancelidber, "{i}", cancelid ); - ber_flatten( cancelidber, &cancelidvalp ); + ber_flatten2( cancelidber, &cancelidvalp, 0 ); rc = ldap_extended_operation( ld, LDAP_EXOP_CANCEL, - cancelidvalp, sctrls, cctrls, msgidp ); + &cancelidvalp, sctrls, cctrls, msgidp ); ber_free( cancelidber, 1 ); return rc; } @@ -62,14 +62,14 @@ ldap_cancel_s( LDAPControl **cctrls ) { BerElement *cancelidber = NULL; - struct berval *cancelidvalp = NULL; + struct berval cancelidvalp = { 0, NULL }; int rc; cancelidber = ber_alloc_t( LBER_USE_DER ); ber_printf( cancelidber, "{i}", cancelid ); - ber_flatten( cancelidber, &cancelidvalp ); + ber_flatten2( cancelidber, &cancelidvalp, 0 ); rc = ldap_extended_operation_s( ld, LDAP_EXOP_CANCEL, - cancelidvalp, sctrls, cctrls, NULL, NULL ); + &cancelidvalp, sctrls, cctrls, NULL, NULL ); ber_free( cancelidber, 1 ); return rc; } -- 2.39.5