Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
8697aa4b
Commit
8697aa4b
authored
23 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Fixup bdb_entry_release now that entry_decode uses two memory blocks
instead of just one.
parent
dffcf0be
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/back-bdb/id2entry.c
+19
-14
19 additions, 14 deletions
servers/slapd/back-bdb/id2entry.c
with
19 additions
and
14 deletions
servers/slapd/back-bdb/id2entry.c
+
19
−
14
View file @
8697aa4b
...
...
@@ -136,20 +136,22 @@ int bdb_entry_return(
BackendDB
*
be
,
Entry
*
e
)
{
/* Our entries are almost always contiguous blocks, so a single
* free() on the Entry pointer suffices. The exception is when
* an entry has been modified, in which case the attr list will
* have been alloc'd separately and its address will no longer
* be a constant offset from (e).
/* Our entries are allocated in two blocks; the data comes from
* the db itself and the Entry structure and associated pointers
* are allocated in entry_decode. The db data pointer is saved
* in e_private. Since the Entry structure is allocated as a single
* block, e_attrs is always a fixed offset from e. The exception
* is when an entry has been modified, in which case we also need
* to free e_attrs.
*/
if
(
(
void
*
)
e
->
e_attrs
!=
(
void
*
)
(
e
+
1
))
{
attrs_free
(
e
->
e_attrs
);
if
(
(
void
*
)
e
->
e_attrs
!=
(
void
*
)
(
e
+
1
))
{
attrs_free
(
e
->
e_attrs
);
}
if
(
e
->
e_private
)
{
free
(
e
->
e_private
);
}
if
(
e
->
e_private
)
free
(
e
->
e_private
);
ch_
free
(
e
);
free
(
e
);
return
0
;
}
...
...
@@ -161,10 +163,13 @@ int bdb_entry_release(
int
rw
)
{
/* A tool will call this with NULL Connection and Operation
* pointers. We don't need to
do anything
in that case,
* pointers. We don't need to
free the e_private
in that case,
* because the tool is getting entries into a realloc'd
* buffer.
*/
if
(
c
&&
o
)
return
bdb_entry_return
(
be
,
e
);
if
(
c
&&
o
)
{
return
bdb_entry_return
(
be
,
e
);
}
else
{
free
(
e
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment