Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Joe Martin
OpenLDAP
Commits
60033b38
Commit
60033b38
authored
25 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Use NULL pointer to indicate values need not be freed instead of
relying on developer selecting the right goto label.
parent
c71fcf58
No related branches found
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-ldbm/modrdn.c
+14
-16
14 additions, 16 deletions
servers/slapd/back-ldbm/modrdn.c
with
14 additions
and
16 deletions
servers/slapd/back-ldbm/modrdn.c
+
14
−
16
View file @
60033b38
...
@@ -271,14 +271,6 @@ ldbm_back_modrdn(
...
@@ -271,14 +271,6 @@ ldbm_back_modrdn(
"ldbm_back_modrdn: new ndn=%s does not exist
\n
"
,
"ldbm_back_modrdn: new ndn=%s does not exist
\n
"
,
new_ndn
,
0
,
0
);
new_ndn
,
0
,
0
);
/* check for abandon */
ldap_pvt_thread_mutex_lock
(
&
op
->
o_abandonmutex
);
if
(
op
->
o_abandon
)
{
ldap_pvt_thread_mutex_unlock
(
&
op
->
o_abandonmutex
);
goto
return_results
;
}
ldap_pvt_thread_mutex_unlock
(
&
op
->
o_abandonmutex
);
/* Get attribute type and attribute value of our new rdn, we will
/* Get attribute type and attribute value of our new rdn, we will
* need to add that to our new entry
* need to add that to our new entry
*/
*/
...
@@ -417,6 +409,14 @@ ldbm_back_modrdn(
...
@@ -417,6 +409,14 @@ ldbm_back_modrdn(
}
}
#endif
#endif
/* check for abandon */
ldap_pvt_thread_mutex_lock
(
&
op
->
o_abandonmutex
);
if
(
op
->
o_abandon
)
{
ldap_pvt_thread_mutex_unlock
(
&
op
->
o_abandonmutex
);
goto
return_results
;
}
ldap_pvt_thread_mutex_unlock
(
&
op
->
o_abandonmutex
);
/* delete old one */
/* delete old one */
if
(
dn2id_delete
(
be
,
e
->
e_ndn
,
e
->
e_id
)
!=
0
)
{
if
(
dn2id_delete
(
be
,
e
->
e_ndn
,
e
->
e_id
)
!=
0
)
{
send_ldap_result
(
conn
,
op
,
LDAP_OPERATIONS_ERROR
,
send_ldap_result
(
conn
,
op
,
LDAP_OPERATIONS_ERROR
,
...
@@ -425,10 +425,15 @@ ldbm_back_modrdn(
...
@@ -425,10 +425,15 @@ ldbm_back_modrdn(
}
}
(
void
)
cache_delete_entry
(
&
li
->
li_cache
,
e
);
(
void
)
cache_delete_entry
(
&
li
->
li_cache
,
e
);
/* XXX: there is no going back! */
free
(
e
->
e_dn
);
free
(
e
->
e_dn
);
free
(
e
->
e_ndn
);
free
(
e
->
e_ndn
);
e
->
e_dn
=
new_dn
;
e
->
e_dn
=
new_dn
;
e
->
e_ndn
=
new_ndn
;
e
->
e_ndn
=
new_ndn
;
new_dn
=
NULL
;
new_ndn
=
NULL
;
/* add new one */
/* add new one */
if
(
dn2id_add
(
be
,
e
->
e_ndn
,
e
->
e_id
)
!=
0
)
{
if
(
dn2id_add
(
be
,
e
->
e_ndn
,
e
->
e_id
)
!=
0
)
{
...
@@ -437,7 +442,6 @@ ldbm_back_modrdn(
...
@@ -437,7 +442,6 @@ ldbm_back_modrdn(
goto
return_results
;
goto
return_results
;
}
}
/* modify memory copy of entry */
/* modify memory copy of entry */
if
(
ldbm_modify_internal
(
be
,
conn
,
op
,
dn
,
&
mod
[
0
],
e
)
if
(
ldbm_modify_internal
(
be
,
conn
,
op
,
dn
,
&
mod
[
0
],
e
)
!=
0
)
{
!=
0
)
{
...
@@ -456,23 +460,17 @@ ldbm_back_modrdn(
...
@@ -456,23 +460,17 @@ ldbm_back_modrdn(
entry_free
(
e
);
entry_free
(
e
);
send_ldap_result
(
conn
,
op
,
LDAP_OPERATIONS_ERROR
,
send_ldap_result
(
conn
,
op
,
LDAP_OPERATIONS_ERROR
,
NULL
,
NULL
,
NULL
,
NULL
);
NULL
,
NULL
,
NULL
,
NULL
);
goto
return_results
_after
;
goto
return_results
;
}
}
send_ldap_result
(
conn
,
op
,
LDAP_SUCCESS
,
send_ldap_result
(
conn
,
op
,
LDAP_SUCCESS
,
NULL
,
NULL
,
NULL
,
NULL
);
NULL
,
NULL
,
NULL
,
NULL
);
rc
=
0
;
rc
=
0
;
goto
return_results_after
;
return_results:
return_results:
if
(
new_dn
!=
NULL
)
free
(
new_dn
);
if
(
new_dn
!=
NULL
)
free
(
new_dn
);
if
(
new_ndn
!=
NULL
)
free
(
new_ndn
);
if
(
new_ndn
!=
NULL
)
free
(
new_ndn
);
return_results_after:
/* NOTE:
* new_dn and new_ndn are not deallocated because they are used by
* the cache entry.
*/
if
(
p_dn
!=
NULL
)
free
(
p_dn
);
if
(
p_dn
!=
NULL
)
free
(
p_dn
);
if
(
p_ndn
!=
NULL
)
free
(
p_ndn
);
if
(
p_ndn
!=
NULL
)
free
(
p_ndn
);
...
...
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