]> git.sur5r.net Git - openldap/commitdiff
Free() -> ldap_memfree() changes. Remove use of the return value of free().
authorHallvard Furuseth <hallvard@openldap.org>
Sat, 27 Mar 1999 16:43:56 +0000 (16:43 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Sat, 27 Mar 1999 16:43:56 +0000 (16:43 +0000)
clients/ud/edit.c
clients/ud/find.c
clients/ud/group.c
clients/ud/main.c
clients/ud/mod.c
clients/ud/print.c
clients/ud/util.c

index 8bdab14f9d77ed19583c56e3a314109806073b82..458a38098a46846bb644b5b7d8253a3a32739537 100644 (file)
@@ -93,7 +93,7 @@ edit( char *who )
        }
        dn = ldap_get_dn(ld, ldap_first_entry(ld, mp));
        rdns = ldap_explode_dn(dn, TRUE);
-       Free(dn);
+       ldap_memfree(dn);
        if (verbose) {
                printf("\n  Editing directory entry \"%s\"...\n", *rdns);
        }
index ce4f1558b0cc9294fecb06a6bb08911b1201b208..8a5e0dddd693a3f278fc3076415aea0396ee4ebf 100644 (file)
@@ -223,7 +223,7 @@ find( char *who, int quiet )
                } else if (matches == 1) {
                        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);
+                       ldap_memfree(dn);
                        if (rc != LDAP_SUCCESS) {
                                int ld_errno = 0;
                                ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ld_errno);
@@ -291,7 +291,7 @@ find( char *who, int quiet )
                                fetch_buffer(response, sizeof(response), stdin);
                                if ((response[0] == 'n') || (response[0] == 'N'))
                                {
-                                       Free(dn);
+                                       ldap_memfree(dn);
                                        return(NULL);
                                }
                        }
@@ -314,7 +314,7 @@ find( char *who, int quiet )
                                ldap_msgfree(res);
                                res = NULL;
                        }
-                       Free(dn);
+                       ldap_memfree(dn);
                        return(res);
                }
                else if (matches > 0) {
index d58dd020b82637f1e9147ef4d909d4278944fc17..54a79a96db72008ef4327d6eab55f3244fe170f8 100644 (file)
@@ -1066,7 +1066,7 @@ list_groups( char *who )
 
        /* lookup the groups belonging to this person */
        sprintf(filter, "owner=%s", dn);
-       Free(dn);
+       ldap_memfree(dn);
        search_attrs[0] = "cn";
        search_attrs[1] = NULL;
        if ((rc = ldap_search_s(ld, UD_WHERE_ALL_GROUPS_LIVE, LDAP_SCOPE_SUBTREE, 
@@ -1199,7 +1199,7 @@ list_memberships( char *who )
 
        /* lookup the groups belonging to this person */
        sprintf(filter, "member=%s", dn);
-       Free(dn);
+       ldap_memfree(dn);
        search_attrs[0] = "cn";
        search_attrs[1] = NULL;
        ldap_msgfree(mp);
index 6dd447411a2623409f716b505c5ca506dee85e68..61de28d4724a9d484f0fdfddca632fd956f9fef6 100644 (file)
@@ -485,7 +485,7 @@ change_base( int type, char **base, char *s )
                        if (j == 0) {
                                (void) ldap_msgfree(mp);
                                for (i = 0; i < matches; i++)
-                                       Free(choices[i]);
+                                       ldap_memfree(choices[i]);
                                return;
                        }
                        if ((j < 1) || (j >= i))
@@ -495,7 +495,7 @@ change_base( int type, char **base, char *s )
                                printbase(output_string, *base);
                                (void) ldap_msgfree(mp);
                                for (i = 0; choices[i] != NULL; i++)
-                                       Free(choices[i]);
+                                       ldap_memfree(choices[i]);
                                return;
                        }
                }
index b0539ba79f486017d0571acfa872e6a5580625f0..82de3e2d57ef77c800ee56cec072ca100d9bf00e 100644 (file)
@@ -147,7 +147,7 @@ modify( char *who )
                parse_answer(mp);
                (void) ldap_msgfree(mp);
        }
-       (void) Free(dn);
+       ldap_memfree(dn);
        ldap_value_free(rdns);
        return;
 }
@@ -483,7 +483,7 @@ mail_is_good:
                        }
                        tmp = ldap_get_dn(ld, elmp);
                        strcpy(buffer, tmp);
-                       Free(tmp);
+                       ldap_memfree(tmp);
                        (void) ldap_msgfree(lmp);
                        break;
                }
index de0a946a90803417b39c85dac33f7531e9f949aa..984ee0b47dca9e00ee6bcfa815543ff5f3c4360d 100644 (file)
@@ -415,7 +415,7 @@ clear_entry( void )
                printf(" Clearing entry \"%s\"\n", Entry.name);
 #endif
        if (Entry.DN != NULL)
-               Free(Entry.DN);
+               ldap_memfree(Entry.DN);
        if (Entry.name != NULL)
                Free(Entry.name);
        Entry.may_join = FALSE;
index 8371c3e867d80449a2c9baf0429a5af38adf5e22..e7ab7626bb3a26f9b3a127d40923dedba0832001 100644 (file)
@@ -579,16 +579,7 @@ Malloc( unsigned int size )
 void
 Free( void *ptr )
 {
-#if 0
-       if (free(ptr) < 0) {
-               perror("free");
-               exit(-1);
-               /*NOTREACHED*/
-       }
-#else
        free(ptr);
-#endif
-       return;
 }
 
 char *