]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-shell/result.c
Happy New Year!
[openldap] / servers / slapd / back-shell / result.c
index 4713d3057caa820d5ad18b3077767c569ac1d62f..571d3c9b8819dae60276a9f07a38d7966257bc1b 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2008 The OpenLDAP Foundation.
+ * Copyright 1998-2012 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -80,7 +80,7 @@ read_and_send_results(
                }
 
                len = strlen( line );
-               while ( bp + len - buf > bsize ) {
+               while ( bp + len + 1 - buf > bsize ) {
                        size_t offset = bp - buf;
                        bsize += BUFSIZ;
                        buf = (char *) ch_realloc( buf, bsize );
@@ -103,6 +103,7 @@ read_and_send_results(
                                rs->sr_flags = REP_ENTRY_MODIFIABLE;
                                send_search_entry( op, rs );
                                entry_free( rs->sr_entry );
+                               rs->sr_attrs = NULL;
                        }
 
                        bp = buf;