]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/unbind.c
Removed numerous memory leaks detected by Mark Meredith.
[openldap] / libraries / libldap / unbind.c
index 676d599385ac7f58881c075ee8f4cc4883391d32..39b3263e4c6dd2b04505c630b7e300fe7924ca84 100644 (file)
@@ -9,6 +9,13 @@
  *  unbind.c
  */
 
+/* An Unbind Request looks like this:
+ *
+ *     UnbindRequest ::= NULL
+ *
+ * and has no response.
+ */
+
 #include "portable.h"
 
 #include <stdio.h>
@@ -154,12 +161,12 @@ ldap_send_unbind(
        Debug( LDAP_DEBUG_TRACE, "ldap_send_unbind\n", 0, 0, 0 );
 
        /* create a message to send */
-       if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
+       if ( (ber = ldap_alloc_ber_with_options( ld )) == NULL ) {
                return( ld->ld_errno );
        }
 
        /* fill it in */
-       if ( ber_printf( ber, "{itn", ++ld->ld_msgid,
+       if ( ber_printf( ber, "{itn" /*}*/, ++ld->ld_msgid,
            LDAP_REQ_UNBIND ) == -1 ) {
                ld->ld_errno = LDAP_ENCODING_ERROR;
                ber_free( ber, 1 );
@@ -172,8 +179,7 @@ ldap_send_unbind(
                return ld->ld_errno;
        }
 
-       if ( ber_printf( ber, "}", ++ld->ld_msgid,
-           LDAP_REQ_UNBIND ) == -1 ) {
+       if ( ber_printf( ber, /*{*/ "}", LDAP_REQ_UNBIND ) == -1 ) {
                ld->ld_errno = LDAP_ENCODING_ERROR;
                ber_free( ber, 1 );
                return( ld->ld_errno );