Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
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
openldap
OpenLDAP
Commits
2107a4c1
Commit
2107a4c1
authored
22 years ago
by
Luke Howard
Browse files
Options
Downloads
Patches
Plain Diff
New DS 5.x memory management API memory management API memory management API memory management API
parent
293c765c
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
servers/slapd/slapi/slapi_utils.c
+59
-0
59 additions, 0 deletions
servers/slapd/slapi/slapi_utils.c
servers/slapd/slapi/slapi_utils.h
+4
-0
4 additions, 0 deletions
servers/slapd/slapi/slapi_utils.h
with
63 additions
and
0 deletions
servers/slapd/slapi/slapi_utils.c
+
59
−
0
View file @
2107a4c1
...
...
@@ -431,6 +431,65 @@ slapi_ch_free_string( char **ptr )
#endif
/* defined(LDAP_SLAPI) */
}
void
slapi_ch_array_free
(
char
**
arrayp
)
{
#ifdef LDAP_SLAPI
char
**
p
;
if
(
arrayp
!=
NULL
)
{
for
(
p
=
arrayp
;
*
p
!=
NULL
;
p
++
)
{
slapi_ch_free
(
(
void
**
)
p
);
}
slapi_ch_free
(
(
void
**
)
&
arrayp
);
}
#endif
}
struct
berval
*
slapi_ch_bvdup
(
const
struct
berval
*
v
)
{
#ifdef LDAP_SLAPI
struct
berval
*
bv
;
bv
=
(
struct
berval
*
)
slapi_ch_malloc
(
sizeof
(
struct
berval
)
);
bv
->
bv_len
=
v
->
bv_len
;
bv
->
bv_val
=
slapi_ch_malloc
(
bv
->
bv_len
);
AC_MEMCPY
(
bv
->
bv_val
,
v
->
bv_val
,
bv
->
bv_len
);
return
bv
;
#else
return
NULL
;
#endif
}
struct
berval
**
slapi_ch_bvecdup
(
const
struct
berval
**
v
)
{
#ifdef LDAP_SLAPI
int
i
;
struct
berval
**
rv
;
if
(
v
==
NULL
)
{
return
NULL
;
}
for
(
i
=
0
;
v
[
i
]
!=
NULL
;
i
++
)
;
rv
=
(
struct
berval
**
)
slapi_ch_malloc
(
(
i
+
1
)
*
sizeof
(
struct
berval
*
)
);
for
(
i
=
0
;
v
[
i
]
!=
NULL
;
i
++
)
{
rv
[
i
]
=
slapi_ch_bvdup
(
v
[
i
]
);
}
rv
[
i
]
=
NULL
;
return
rv
;
#else
return
NULL
;
#endif
}
char
*
slapi_ch_calloc
(
unsigned
long
nelem
,
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/slapi/slapi_utils.h
+
4
−
0
View file @
2107a4c1
...
...
@@ -134,6 +134,10 @@ void slapi_ch_free_string( char **s );
char
*
slapi_ch_calloc
(
unsigned
long
nelem
,
unsigned
long
size
);
char
*
slapi_ch_realloc
(
char
*
block
,
unsigned
long
size
);
char
*
slapi_ch_strdup
(
char
*
s
);
void
slapi_ch_array_free
(
char
**
arrayp
);
struct
berval
*
slapi_ch_bvdup
(
const
struct
berval
*
v
);
struct
berval
**
slapi_ch_bvecdup
(
const
struct
berval
**
v
);
/*
* FIXME: these two were missing, but widely used in a couple of .c files
*/
...
...
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