Skip to content
Snippets Groups Projects
Commit 3a119bf1 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Update man pages based upon required use of ldap_memfree() instead of free()

	replace 'malloced' with 'dynamically allocated'
	State ldap_memfree(3) should be used instead of free()
	Still need ldap_memfree(3) man page.
parent 32d9cc23
No related branches found
No related tags found
No related merge requests found
...@@ -206,8 +206,9 @@ set to the actual size of the octet string. ...@@ -206,8 +206,9 @@ set to the actual size of the octet string.
.TP .TP
.SM O .SM O
Octet string. A struct ber_val ** should be supplied, which upon return Octet string. A struct ber_val ** should be supplied, which upon return
points to a malloced struct berval containing the octet string and its points to a dynamically allocated struct berval containing the octet string
length. ber_bvfree() can be called to free the malloced memory. and its length. ber_bvfree() can be called to free the dynamically
allocated memory.
.TP .TP
.SM b .SM b
Boolean. A pointer to an integer should be supplied. Boolean. A pointer to an integer should be supplied.
...@@ -216,7 +217,8 @@ Boolean. A pointer to an integer should be supplied. ...@@ -216,7 +217,8 @@ Boolean. A pointer to an integer should be supplied.
Integer. A pointer to an integer should be supplied. Integer. A pointer to an integer should be supplied.
.TP .TP
.SM B .SM B
Bitstring. A char ** should be supplied which will point to the malloced Bitstring. A char ** should be supplied which will point to the
dynamically allocated
bits, followed by an unsigned long *, which will point to the length bits, followed by an unsigned long *, which will point to the length
(in bits) of the bitstring returned. (in bits) of the bitstring returned.
.TP .TP
...@@ -226,16 +228,17 @@ it is recognized. ...@@ -226,16 +228,17 @@ it is recognized.
.TP .TP
.SM v .SM v
Sequence of octet strings. A char *** should be supplied, which upon Sequence of octet strings. A char *** should be supplied, which upon
return points to a malloced null-terminated array of char *'s return points to a dynamically allocated null-terminated array of char *'s
containing the octet strings. NULL is returned if the sequence is empty. containing the octet strings. NULL is returned if the sequence is empty.
.TP .TP
.SM V .SM V
Sequence of octet strings with lengths. Sequence of octet strings with lengths.
A struct berval *** should be supplied, which upon A struct berval *** should be supplied, which upon
return points to a malloced null-terminated array of struct berval *'s return points to a dynamically allocated null-terminated array of
struct berval *'s
containing the octet strings and their lengths. containing the octet strings and their lengths.
NULL is returned if the sequence is empty. ber_bvecfree() can be called NULL is returned if the sequence is empty. ber_bvecfree() can be called
to free the malloced memory. to free the dynamically allocated memory.
.TP .TP
.SM x .SM x
Skip element. The next element is skipped. Skip element. The next element is skipped.
...@@ -265,12 +268,13 @@ the size of the buffer, and will contain the length of the octet string ...@@ -265,12 +268,13 @@ the size of the buffer, and will contain the length of the octet string
read upon return. The buffer should be big enough to take the octet read upon return. The buffer should be big enough to take the octet
string value plus a terminating NULL byte. string value plus a terminating NULL byte.
.LP .LP
The ber_get_stringa() routine is used to malloc space into which an octet The ber_get_stringa() routine is used to dynamically allocate space into
which an octet
string is read. string is read.
.LP .LP
The ber_get_stringal() routine is used to malloc space into which an octet The ber_get_stringal() routine is used to dynamically allocate space
string and its length are read. It takes a struct berval **, and returns into which an octet string and its length are read. It takes a
the result in this parameter. struct berval **, and returns the result in this parameter.
.LP .LP
The ber_get_null() routine is used to read a NULL element. It returns The ber_get_null() routine is used to read a NULL element. It returns
the tag of the element it skips over. the tag of the element it skips over.
...@@ -279,7 +283,7 @@ The ber_get_boolean() routine is used to read a boolean value. It is called ...@@ -279,7 +283,7 @@ The ber_get_boolean() routine is used to read a boolean value. It is called
the same way that ber_get_int() is called. the same way that ber_get_int() is called.
.LP .LP
The ber_get_bitstringa() routine is used to read a bitstring value. It The ber_get_bitstringa() routine is used to read a bitstring value. It
takes a char ** which will hold the malloced bits, followed by an takes a char ** which will hold the dynamically allocated bits, followed by an
unsigned long *, which will point to the length (in bits) of the unsigned long *, which will point to the length (in bits) of the
bitstring returned. bitstring returned.
.LP .LP
...@@ -330,7 +334,9 @@ If an error occurs during decoding, generally these routines return -1. ...@@ -330,7 +334,9 @@ If an error occurs during decoding, generally these routines return -1.
.SH NOTES .SH NOTES
.LP .LP
The return values for all of these functions are declared in the The return values for all of these functions are declared in the
<lber.h> header file. Some routines may malloc memory. <lber.h> header file.
Some routines may dynamically allocate memory
which must be freed by the caller using supplied deallocation routines.
.SH SEE ALSO .SH SEE ALSO
.BR lber-encode (3) .BR lber-encode (3)
.BR ldap-parse (3) .BR ldap-parse (3)
......
...@@ -192,10 +192,7 @@ equivalent to ...@@ -192,10 +192,7 @@ equivalent to
.BR ldap_unbind (3) .BR ldap_unbind (3)
.TP .TP
.SM ldap_memfree (3) .SM ldap_memfree (3)
dispose of memory allocated by LDAP routines (this is only used on the dispose of memory allocated by LDAP routines.
Microsoft Windows platforms; use
.BR free (3)
on all other platforms).
.TP .TP
.SM ldap_enable_cache(3) .SM ldap_enable_cache(3)
enable LDAP client caching enable LDAP client caching
......
...@@ -95,7 +95,7 @@ to be translated and \fI*lenp\fP should contain the number of bytes to ...@@ -95,7 +95,7 @@ to be translated and \fI*lenp\fP should contain the number of bytes to
translate. If \fIfree_input\fP is non-zero, the input buffer will be translate. If \fIfree_input\fP is non-zero, the input buffer will be
freed if translation is a success. If the translation is a success, freed if translation is a success. If the translation is a success,
LDAP_SUCCESS will be returned, \fI*bufp\fP will point to a newly LDAP_SUCCESS will be returned, \fI*bufp\fP will point to a newly
malloc'd buffer that contains the translated characters, and dynamically allocated buffer that contains the translated characters, and
\fI*lenp\fP will contain the length of the result. If translation \fI*lenp\fP will contain the length of the result. If translation
fails, an LDAP error code will be returned. fails, an LDAP error code will be returned.
......
...@@ -189,7 +189,7 @@ An unknown error occurred. ...@@ -189,7 +189,7 @@ An unknown error occurred.
The LDAP library can't contact the LDAP server. The LDAP library can't contact the LDAP server.
.TP .TP
.SM LDAP_LOCAL_ERROR .SM LDAP_LOCAL_ERROR
Some local error occurred. This is usually a failed malloc. Some local error occurred. This is usually a failed dynamic memory allocation.
.TP .TP
.SM LDAP_ENCODING_ERROR .SM LDAP_ENCODING_ERROR
An error was encountered encoding parameters to send to the LDAP server. An error was encountered encoding parameters to send to the LDAP server.
...@@ -212,7 +212,8 @@ An ldap routine was called with a bad parameter (e.g., a NULL ld ...@@ -212,7 +212,8 @@ An ldap routine was called with a bad parameter (e.g., a NULL ld
pointer, etc.). pointer, etc.).
.TP .TP
.SM LDAP_NO_MEMORY .SM LDAP_NO_MEMORY
An memory allocation (e.g., malloc(3)) call failed in an ldap An memory allocation (e.g., malloc(3) or other dynamic memory
allocator) call failed in an ldap
library routine. library routine.
.SH SEE ALSO .SH SEE ALSO
.BR ldap(3), .BR ldap(3),
......
...@@ -69,7 +69,7 @@ for a description of possible error codes. ...@@ -69,7 +69,7 @@ for a description of possible error codes.
.SH NOTES .SH NOTES
The The
.B ldap_first_attribute() .B ldap_first_attribute()
routine mallocs memory that may need to routine dyanamically allocated memory that may need to
be freed by the caller via be freed by the caller via
.BR ber_free (3). .BR ber_free (3).
.SH SEE ALSO .SH SEE ALSO
......
...@@ -53,10 +53,9 @@ routine takes an \fIentry\fP as returned by ...@@ -53,10 +53,9 @@ routine takes an \fIentry\fP as returned by
or or
.BR ldap_next_entry (3) .BR ldap_next_entry (3)
and returns a copy of and returns a copy of
the entry's DN. Space for the DN will have been obtained via the entry's DN. Space for the DN will be obtained dynamically
.BR malloc (3), and should be freed by the caller using
and should be freed by the caller by a call to .BR ldap_memfree (3).
.BR free (3).
.LP .LP
The The
.B ldap_explode_dn() .B ldap_explode_dn()
...@@ -89,10 +88,9 @@ is used to turn a DN as returned by ...@@ -89,10 +88,9 @@ is used to turn a DN as returned by
into a more user-friendly form, stripping off type names. See into a more user-friendly form, stripping off type names. See
RFC 1781 "Using the Directory to Achieve User Friendly Naming" RFC 1781 "Using the Directory to Achieve User Friendly Naming"
for more details on the UFN format. The space for the UFN returned for more details on the UFN format. The space for the UFN returned
is obtained by a call to is obtained dynamically and the user is responsible for freeing it
.BR malloc (3), via a call to
and the user is responsible for freeing it via a call to .BR ldap_memfree (3).
.BR free (3).
.LP .LP
.B ldap_is_dns_dn() .B ldap_is_dns_dn()
returns non-zero if the dn string is an experimental returns non-zero if the dn string is an experimental
...@@ -124,11 +122,12 @@ will return NULL with ...@@ -124,11 +122,12 @@ will return NULL with
.BR errno (3) .BR errno (3)
set appropriately in case of trouble. set appropriately in case of trouble.
.SH NOTES .SH NOTES
These routines malloc memory that the caller must free. These routines dyanamically allocate memory that the caller must free.
.SH SEE ALSO .SH SEE ALSO
.BR ldap(3), .BR ldap(3),
.BR ldap_first_entry(3),
.BR ldap_error(3), .BR ldap_error(3),
.BR ldap_first_entry(3),
.BR ldap_memfree(3),
.BR ldap_value_free(3) .BR ldap_value_free(3)
.SH ACKNOWLEDGEMENTS .SH ACKNOWLEDGEMENTS
.B OpenLDAP .B OpenLDAP
......
...@@ -91,7 +91,8 @@ indicate the error. See ...@@ -91,7 +91,8 @@ indicate the error. See
.BR ldap_error (3) .BR ldap_error (3)
for a description of possible error codes. for a description of possible error codes.
.SH NOTES .SH NOTES
These routines malloc memory that the caller must free. These routines dynamically allocate memory which the caller must free
using the supplied routines.
.SH SEE ALSO .SH SEE ALSO
.BR ldap(3), .BR ldap(3),
.BR ldap_first_entry(3), .BR ldap_first_entry(3),
......
...@@ -185,7 +185,9 @@ are no more appropriate filters to return. ...@@ -185,7 +185,9 @@ are no more appropriate filters to return.
.SH NOTES .SH NOTES
.LP .LP
The return values for all of these functions are declared in the The return values for all of these functions are declared in the
<ldap.h> header file. Some routines may malloc memory. <ldap.h> header file.
Some routines may dynamically allocate memory
which the caller must free using the supplied deallocator routines.
.SH FILES .SH FILES
ETCDIR/ldapfilter.conf ETCDIR/ldapfilter.conf
.SH SEE ALSO .SH SEE ALSO
......
...@@ -119,8 +119,8 @@ and ...@@ -119,8 +119,8 @@ and
.B ldap_msgid() .B ldap_msgid()
return -1 on error. return -1 on error.
.SH NOTES .SH NOTES
This routine mallocs memory for results that it receives. The memory This routine dynamically allocates memory for results that it receives.
can be freed by calling The memory can be freed by the caller using
.BR ldap_msgfree . .BR ldap_msgfree .
.SH SEE ALSO .SH SEE ALSO
.BR ldap (3), .BR ldap (3),
......
...@@ -107,7 +107,9 @@ and list functionality are subsumed by these routines, ...@@ -107,7 +107,9 @@ and list functionality are subsumed by these routines,
by using a filter like "objectclass=*" and a scope of LDAP_SCOPE_BASE (to by using a filter like "objectclass=*" and a scope of LDAP_SCOPE_BASE (to
emulate read) or LDAP_SCOPE_ONELEVEL (to emulate list). emulate read) or LDAP_SCOPE_ONELEVEL (to emulate list).
.LP .LP
These routines may malloc memory. Return values are contained These routines may dynamically allocate memory. The caller is
responsible for freeing such memory using supplied deallocation
routines. Return values are contained
in <ldap.h>. in <ldap.h>.
.SH SEE ALSO .SH SEE ALSO
.BR ldap (3), .BR ldap (3),
......
...@@ -93,7 +93,9 @@ may produce unexpected results for multi-valued attributes. ...@@ -93,7 +93,9 @@ may produce unexpected results for multi-valued attributes.
When sorting by DN, the comparison function is When sorting by DN, the comparison function is
applied to an exploded version of the DN, without types. applied to an exploded version of the DN, without types.
The return values for all of these functions are declared in the The return values for all of these functions are declared in the
<ldap.h> header file. Some routines may malloc memory. <ldap.h> header file. Some routines may dynamically allocate memory.
Callers are responsible for freeing such memory using the supplied
deallocation routines.
.SH SEE ALSO .SH SEE ALSO
.BR ldap (3), .BR ldap (3),
.BR ldap_search (3), .BR ldap_search (3),
......
...@@ -119,7 +119,9 @@ should actually be a pointer to a struct timeval (this is so ...@@ -119,7 +119,9 @@ should actually be a pointer to a struct timeval (this is so
.B ldap_ufn_timeout() .B ldap_ufn_timeout()
can be used as a cancelproc in the above routines). can be used as a cancelproc in the above routines).
.SH NOTES .SH NOTES
These routines may malloc memory. Return values are contained These routines may dynamically allocate memory. The caller is
required to free such memory using the supplied deallocation routines.
Return values are contained
in <ldap.h>. in <ldap.h>.
.SH SEE ALSO .SH SEE ALSO
.BR gettimeofday (2), .BR gettimeofday (2),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment