s4:heimdal A real fix for bug 6801
authorAndrew Bartlett <abartlet@samba.org>
Tue, 13 Oct 2009 22:04:16 +0000 (09:04 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 13 Oct 2009 23:20:01 +0000 (10:20 +1100)
The issue was that we would free the entry after the database, not
knowing that the entry was a talloc child of the database.

Andrew Bartlett

source4/heimdal/lib/hdb/keytab.c

index a557de036d0312fef289db3e5ec1fc62b4e97c53..6cab8a44f0bbfd0fec3f3817a985da62be9f8293 100644 (file)
@@ -401,12 +401,12 @@ hdb_end_seq_get(krb5_context context,
 {
     struct hdb_cursor *c = cursor->data;
 
 {
     struct hdb_cursor *c = cursor->data;
 
-    (c->db->hdb_close)(context, c->db);
-    (c->db->hdb_destroy)(context, c->db);
-
     if (!c->next)
        hdb_free_entry(context, &c->hdb_entry);
 
     if (!c->next)
        hdb_free_entry(context, &c->hdb_entry);
 
+    (c->db->hdb_close)(context, c->db);
+    (c->db->hdb_destroy)(context, c->db);
+
     free(c);
     return 0;
 }
     free(c);
     return 0;
 }