1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

s4-ldb: fixed a memory leak

This commit is contained in:
Andrew Tridgell 2009-09-22 22:15:11 -07:00 committed by Matthias Dieter Wallnöfer
parent e7846f69ca
commit c7358d9890

View File

@ -135,6 +135,7 @@ static int ltdb_convert_from_idxptr(struct ldb_module *module, struct ldb_messag
return LDB_ERR_OPERATIONS_ERROR;
}
talloc_free(el->values);
*el = ptr->el;
if (ptr_out) {
@ -163,7 +164,11 @@ static int ltdb_update_idxptr(struct ldb_module *module, TALLOC_CTX *mem_ctx,
el->values = val2;
el->num_values = 1;
el->values[0].data = talloc_memdup(el->values, &ptr, sizeof(ptr));
if (strcmp(el->name, LTDB_IDXPTR) == 0) {
abort();
}
el->values[0].data = talloc_memdup(val2, &ptr, sizeof(ptr));
el->values[0].length = sizeof(ptr);
/* update the name */