From 6bcafceb750d5c4d24e2ddbef35b411bebccd66f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 7 Dec 2012 19:02:10 +0100 Subject: s4:dsdb/dirsync: fix potential talloc hierachy problems (bug #9470) Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- source4/dsdb/samdb/ldb_modules/dirsync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/dsdb/samdb/ldb_modules/dirsync.c b/source4/dsdb/samdb/ldb_modules/dirsync.c index f75ec521d3..e769948508 100644 --- a/source4/dsdb/samdb/ldb_modules/dirsync.c +++ b/source4/dsdb/samdb/ldb_modules/dirsync.c @@ -240,7 +240,7 @@ static int dirsync_filter_entry(struct ldb_request *req, talloc_steal(newmsg->elements, el->name); talloc_steal(newmsg->elements, el->values); - talloc_free(msg); + talloc_steal(newmsg->elements, msg); return ldb_module_send_entry(dsc->req, msg, controls); } @@ -653,6 +653,7 @@ skip_link: continue; } } + talloc_steal(newmsg->elements, msg); /* * Here we run through the list of attributes returned @@ -685,10 +686,9 @@ skip_link: if (val > dsc->highestUSN) { dsc->highestUSN = val; } - talloc_free(msg); return ldb_module_send_entry(dsc->req, newmsg, controls); } else { - talloc_free(msg); + talloc_free(newmsg); return LDB_SUCCESS; } } -- cgit