summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-12-17 19:24:13 +0000
committerStefan Metzmacher <metze@samba.org>2005-12-17 19:24:13 +0000
commit161de7b0387612e868962fda4a6e2f7c9ddacffa (patch)
tree2bc634c39a13ddc46b506d0bac26fd4c6953f0a1 /source
parent7a9d731cb9fb09ebecd216391e76f92ead896b33 (diff)
downloadsamba-161de7b0387612e868962fda4a6e2f7c9ddacffa.tar.gz
samba-161de7b0387612e868962fda4a6e2f7c9ddacffa.tar.xz
samba-161de7b0387612e868962fda4a6e2f7c9ddacffa.zip
r12309: fix a crash bug, which appens in an error case
metze
Diffstat (limited to 'source')
-rw-r--r--source/wrepl_server/wrepl_out_push.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/wrepl_server/wrepl_out_push.c b/source/wrepl_server/wrepl_out_push.c
index d3e4bdb44b6..0afa6c57042 100644
--- a/source/wrepl_server/wrepl_out_push.c
+++ b/source/wrepl_server/wrepl_out_push.c
@@ -40,19 +40,20 @@ static void wreplsrv_out_partner_push(struct wreplsrv_partner *partner, BOOL pro
static void wreplsrv_push_handler_creq(struct composite_context *creq)
{
struct wreplsrv_partner *partner = talloc_get_type(creq->async.private_data, struct wreplsrv_partner);
+ struct wreplsrv_push_notify_io *old_notify_io;
partner->push.last_status = wreplsrv_push_notify_recv(partner->push.creq);
partner->push.creq = NULL;
- talloc_free(partner->push.notify_io);
- partner->push.notify_io = NULL;
-
partner->push.last_run = timeval_current();
+ old_notify_io = partner->push.notify_io;
+ partner->push.notify_io = NULL;
+
if (NT_STATUS_IS_OK(partner->push.last_status)) {
partner->push.error_count = 0;
DEBUG(2,("wreplsrv_push_notify(%s): %s\n",
partner->address, nt_errstr(partner->push.last_status)));
- return;
+ goto done;
}
partner->push.error_count++;
@@ -61,13 +62,15 @@ static void wreplsrv_push_handler_creq(struct composite_context *creq)
DEBUG(1,("wreplsrv_push_notify(%s): %s: error_count: %u: giving up\n",
partner->address, nt_errstr(partner->push.last_status),
partner->push.error_count));
- return;
+ goto done;
}
DEBUG(1,("wreplsrv_push_notify(%s): %s: error_count: %u: retry\n",
partner->address, nt_errstr(partner->push.last_status),
partner->push.error_count));
- wreplsrv_out_partner_push(partner, partner->push.notify_io->in.propagate);
+ wreplsrv_out_partner_push(partner, old_notify_io->in.propagate);
+done:
+ talloc_free(old_notify_io);
}
static void wreplsrv_out_partner_push(struct wreplsrv_partner *partner, BOOL propagate)