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
5a14af5f
Commit
5a14af5f
authored
26 years ago
by
Hallvard Furuseth
Browse files
Options
Downloads
Patches
Plain Diff
Memory leaks: Values from ldap_get_dn were not freed.
parent
ede86e4d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clients/ud/find.c
+8
-2
8 additions, 2 deletions
clients/ud/find.c
clients/ud/mod.c
+2
-0
2 additions, 0 deletions
clients/ud/mod.c
with
10 additions
and
2 deletions
clients/ud/find.c
+
8
−
2
View file @
5a14af5f
...
...
@@ -235,7 +235,10 @@ int quiet;
ldap_set_option
(
ld
,
LDAP_OPT_DEREF
,
&
savederef
);
return
(
NULL
);
}
else
if
(
matches
==
1
)
{
if
(
ldap_search_s
(
ld
,
ldap_get_dn
(
ld
,
ldap_first_entry
(
ld
,
res
)),
LDAP_SCOPE_BASE
,
"objectClass=*"
,
read_attrs
,
FALSE
,
&
res
)
!=
LDAP_SUCCESS
)
{
dn
=
ldap_get_dn
(
ld
,
ldap_first_entry
(
ld
,
res
));
rc
=
ldap_search_s
(
ld
,
dn
,
LDAP_SCOPE_BASE
,
"objectClass=*"
,
read_attrs
,
FALSE
,
&
res
);
Free
(
dn
);
if
(
rc
!=
LDAP_SUCCESS
)
{
int
ld_errno
=
0
;
ldap_get_option
(
ld
,
LDAP_OPT_ERROR_NUMBER
,
&
ld_errno
);
if
(
ld_errno
==
LDAP_UNAVAILABLE
)
...
...
@@ -301,7 +304,10 @@ int quiet;
fflush
(
stdout
);
fetch_buffer
(
response
,
sizeof
(
response
),
stdin
);
if
((
response
[
0
]
==
'n'
)
||
(
response
[
0
]
==
'N'
))
{
Free
(
dn
);
return
(
NULL
);
}
}
#ifdef DEBUG
if
(
debug
&
D_FIND
)
{
...
...
@@ -320,7 +326,7 @@ int quiet;
if
(
ldap_search_s
(
ld
,
dn
,
LDAP_SCOPE_BASE
,
"objectClass=*"
,
read_attrs
,
FALSE
,
&
res
)
!=
LDAP_SUCCESS
)
{
ldap_perror
(
ld
,
"ldap_search_s"
);
ldap_msgfree
(
res
);
re
turn
(
NULL
)
;
re
s
=
NULL
;
}
Free
(
dn
);
return
(
res
);
...
...
This diff is collapsed.
Click to expand it.
clients/ud/mod.c
+
2
−
0
View file @
5a14af5f
...
...
@@ -21,6 +21,7 @@
#include
<lber.h>
#include
<ldap.h>
#include
"ud.h"
extern
void
Free
();
extern
struct
entry
Entry
;
extern
int
verbose
;
...
...
@@ -497,6 +498,7 @@ mail_is_good:
}
tmp
=
ldap_get_dn
(
ld
,
elmp
);
strcpy
(
buffer
,
tmp
);
Free
(
tmp
);
(
void
)
ldap_msgfree
(
lmp
);
break
;
}
...
...
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