diff options
Diffstat (limited to 'plugins/Dbx_mdb/src/lmdb/midl.c')
-rw-r--r-- | plugins/Dbx_mdb/src/lmdb/midl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/Dbx_mdb/src/lmdb/midl.c b/plugins/Dbx_mdb/src/lmdb/midl.c index 5c6d841a7a..88a3aff10c 100644 --- a/plugins/Dbx_mdb/src/lmdb/midl.c +++ b/plugins/Dbx_mdb/src/lmdb/midl.c @@ -3,7 +3,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software <http://www.openldap.org/>. * - * Copyright 2000-2015 The OpenLDAP Foundation. + * Copyright 2000-2014 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -116,15 +116,17 @@ void mdb_midl_free(MDB_IDL ids) free(ids-1); } -void mdb_midl_shrink( MDB_IDL *idp ) +int mdb_midl_shrink( MDB_IDL *idp ) { MDB_IDL ids = *idp; if (*(--ids) > MDB_IDL_UM_MAX && - (ids = realloc(ids, (MDB_IDL_UM_MAX+2) * sizeof(MDB_ID)))) + (ids = realloc(ids, (MDB_IDL_UM_MAX+1) * sizeof(MDB_ID)))) { *ids++ = MDB_IDL_UM_MAX; *idp = ids; + return 1; } + return 0; } static int mdb_midl_grow( MDB_IDL *idp, int num ) |