summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_cache.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-02 23:03:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:11 -0500
commit3e5235a568777b5103612069e413cabe37b83c2b (patch)
tree7905b2a154d572e85585353cfb2e2c07c21e0d8c /source4/lib/ldb/ldb_tdb/ldb_cache.c
parentb3eab2f9e7d7dbb8b0621bf621b76bf54faabf89 (diff)
downloadsamba-3e5235a568777b5103612069e413cabe37b83c2b.tar.gz
samba-3e5235a568777b5103612069e413cabe37b83c2b.tar.bz2
samba-3e5235a568777b5103612069e413cabe37b83c2b.zip
r4486: fixed some memory leaks in the new ldb code, by ensuring that memory is always
allocated as a child of the right context (This used to be commit 1071712cf5951fa2e94f314bd7678cfa51b2dbcd)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_cache.c')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_cache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_cache.c b/source4/lib/ldb/ldb_tdb/ldb_cache.c
index e7420c5f7a..037403d81e 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_cache.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_cache.c
@@ -205,14 +205,14 @@ int ltdb_increase_sequence_number(struct ldb_module *module)
char *s = NULL;
int ret;
- s = talloc_asprintf(ldb, "%.0f", ltdb->sequence_number+1);
- if (!s) {
+ msg = talloc_p(ltdb, struct ldb_message);
+ if (msg == NULL) {
errno = ENOMEM;
return -1;
}
- msg = talloc_p(ltdb, struct ldb_message);
- if (msg == NULL) {
+ s = talloc_asprintf(msg, "%.0f", ltdb->sequence_number+1);
+ if (!s) {
errno = ENOMEM;
return -1;
}