]> git.sur5r.net Git - openldap/blobdiff - libraries/liblber/io.c
ITS#7182 Enable operation and connection monitoring.
[openldap] / libraries / liblber / io.c
index 8b08e385876cba4d83e4cfa30cd579875ad6fc25..a62161495ab8fca8145953d6feca905341368279 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2011 The OpenLDAP Foundation.
+ * Copyright 1998-2012 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -390,16 +390,15 @@ int ber_flatten2(
                return -1;
        }
 
-       /* unmatched "{" and "}" */
-       if ( ber->ber_sos_ptr != NULL ) {
-               return -1;
-       }
-
        if ( ber == NULL ) {
                /* ber is null, create an empty berval */
                bv->bv_val = NULL;
                bv->bv_len = 0;
 
+       } else if ( ber->ber_sos_ptr != NULL ) {
+               /* unmatched "{" and "}" */
+               return -1;
+
        } else {
                /* copy the berval */
                ber_len_t len = ber_pvt_ber_write( ber );