From ec737d96048f3cd34cb2de7f939d93586c4a930f Mon Sep 17 00:00:00 2001 From: Gregor Beck Date: Fri, 29 Jun 2012 11:42:34 +0200 Subject: [PATCH] s3:cclean avoid segfault in case of ctdb missbehaviour Signed-off-by: Michael Adam Autobuild-User(master): Michael Adam Autobuild-Date(master): Fri Jun 29 17:06:05 CEST 2012 on sn-devel-104 --- source3/utils/cclean.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source3/utils/cclean.c b/source3/utils/cclean.c index d98725e7fb4f..487c107e472b 100644 --- a/source3/utils/cclean.c +++ b/source3/utils/cclean.c @@ -53,9 +53,14 @@ static void print_record(const char *msg, const struct connections_data *d) { char *idstr = serverid_str(k->pid); - d_printf("%s: connection %d (%s) to \"%s\" from %u:%u@%s[%s] %s\n", msg, - k->cnum, idstr, d->servicename, (unsigned)d->uid, - (unsigned)d->gid, d->machine, d->addr, time_to_asc(d->start)); + d_printf("%s: connection %d (%s) ", msg, k->cnum, idstr); + if (d == NULL) { + d_printf("\n"); + } else { + d_printf("to \"%s\" from %u:%u@%s[%s] %s\n", d->servicename, + (unsigned)d->uid, (unsigned)d->gid, d->machine, + d->addr, time_to_asc(d->start)); + } talloc_free(idstr); } -- 2.34.1