Use talloc to alloc conn memory
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 20 Feb 2013 23:01:26 +0000 (18:01 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 20 Feb 2013 23:01:59 +0000 (18:01 -0500)
src/modules/rlm_ldap/rlm_ldap.c

index e9e4205..71b2db2 100644 (file)
@@ -658,7 +658,7 @@ static void *ldap_conn_create(void *ctx)
        }
 #endif /* HAVE_LDAP_START_TLS */
 
-       conn = rad_malloc(sizeof(*conn));
+       conn = talloc(NULL, LDAP_CONN);
        conn->inst = inst;
        conn->handle = handle;
        conn->rebound = FALSE;
@@ -682,7 +682,7 @@ static int ldap_conn_delete(UNUSED void *ctx, void *connection)
        LDAP_CONN *conn = connection;
 
        ldap_unbind_s(conn->handle);
-       free(conn);
+       talloc_free(conn);
 
        return 0;
 }