summaryrefslogtreecommitdiff
path: root/source4/wrepl_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-12-17 19:24:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:28 -0500
commit810833ad93ede2caabebbe78e354651508fb4d2a (patch)
tree2032d4f31613db3a6cba6de42d85ce942fb53d47 /source4/wrepl_server
parent736543016e35882d2ad784c3598a3e8c2c7fcc7b (diff)
downloadsamba-810833ad93ede2caabebbe78e354651508fb4d2a.tar.gz
samba-810833ad93ede2caabebbe78e354651508fb4d2a.tar.bz2
samba-810833ad93ede2caabebbe78e354651508fb4d2a.zip
r12309: fix a crash bug, which appens in an error case
metze (This used to be commit 292bb4b6cb600ce286ded90d32d72123fdaae1d7)
Diffstat (limited to 'source4/wrepl_server')
-rw-r--r--source4/wrepl_server/wrepl_out_push.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source4/wrepl_server/wrepl_out_push.c b/source4/wrepl_server/wrepl_out_push.c
index d3e4bdb44b..0afa6c5704 100644
--- a/source4/wrepl_server/wrepl_out_push.c
+++ b/source4/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)