]> git.sur5r.net Git - openldap/commitdiff
Hack to free seqorset when ber_free(ber, 1) is called.
authorKurt Zeilenga <kurt@openldap.org>
Thu, 21 Oct 1999 17:52:33 +0000 (17:52 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 21 Oct 1999 17:52:33 +0000 (17:52 +0000)
libraries/liblber/io.c

index cbcbb84ba3c30cdadaf5b7766251fa39265b09a6..57a2eceb4b9a5607d140ddc79663837097fe5795 100644 (file)
@@ -202,10 +202,18 @@ ber_free( BerElement *ber, int freebuf )
 
        assert( BER_VALID( ber ) );
 
-       if ( freebuf && ber->ber_buf != NULL )
+       if ( freebuf ) {
+               Seqorset *s, *next;
                LBER_FREE( ber->ber_buf );
 
+               for( s = ber->ber_sos ; s != NULL ; s = next ) {
+                       next = s->sos_next;
+                       LBER_FREE( s );
+               }
+       }
+
        ber->ber_buf = NULL;
+       ber->ber_sos = NULL;
        ber->ber_valid = LBER_UNINITIALIZED;
 
        LBER_FREE( (char *) ber );