diff options
Diffstat (limited to 'lib/ldb/ldb_tdb/ldb_search.c')
-rw-r--r-- | lib/ldb/ldb_tdb/ldb_search.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ldb/ldb_tdb/ldb_search.c b/lib/ldb/ldb_tdb/ldb_search.c index fdae4cba62b..02890862cf7 100644 --- a/lib/ldb/ldb_tdb/ldb_search.c +++ b/lib/ldb/ldb_tdb/ldb_search.c @@ -408,7 +408,7 @@ int ltdb_filter_attrs(TALLOC_CTX *mem_ctx, /* Shortcuts for the simple cases */ } else if (add_dn && i == 1) { if (msg_add_distinguished_name(msg2) != 0) { - return -1; + goto failed; } *filtered_msg = msg2; return 0; @@ -474,7 +474,7 @@ int ltdb_filter_attrs(TALLOC_CTX *mem_ctx, if (add_dn) { if (msg_add_distinguished_name(msg2) != 0) { - return -1; + goto failed; } } @@ -483,7 +483,7 @@ int ltdb_filter_attrs(TALLOC_CTX *mem_ctx, struct ldb_message_element, msg2->num_elements); if (msg2->elements == NULL) { - return -1; + goto failed; } } else { talloc_free(msg2->elements); @@ -494,6 +494,7 @@ int ltdb_filter_attrs(TALLOC_CTX *mem_ctx, return 0; failed: + TALLOC_FREE(msg2); return -1; } |