]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/sort.c
s/exit(1)/exit(EXIT_FAILURE)/
[openldap] / libraries / libldap / sort.c
index 36570bb1331c7ad6c9931f10e7162012a318b2a3..d7ea4e434f6110fb90d95ece2a97749b1468d754 100644 (file)
@@ -19,7 +19,7 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <stdlib.h>
+#include <ac/stdlib.h>
 
 #include <ac/ctype.h>
 #include <ac/string.h>
@@ -103,7 +103,7 @@ ldap_sort_entries(
                return 0;
        }
 
-       if ( (et = (struct entrything *) malloc( count *
+       if ( (et = (struct entrything *) LDAP_MALLOC( count *
            sizeof(struct entrything) )) == NULL ) {
                ld->ld_errno = LDAP_NO_MEMORY;
                return( -1 );
@@ -118,7 +118,7 @@ ldap_sort_entries(
 
                        dn = ldap_get_dn( ld, e );
                        et[i].et_vals = ldap_explode_dn( dn, 1 );
-                       free( dn );
+                       LDAP_FREE( dn );
                } else {
                        et[i].et_vals = ldap_get_values( ld, e, attr );
                }
@@ -137,7 +137,7 @@ ldap_sort_entries(
                ldap_value_free( et[i].et_vals );
        }
        *ep = last;
-       free( (char *) et );
+       LDAP_FREE( (char *) et );
 
        return( 0 );
 }