s3:cclean avoid segfault in case of ctdb missbehaviour
authorGregor Beck <gbeck@sernet.de>
Fri, 29 Jun 2012 09:42:34 +0000 (11:42 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 29 Jun 2012 15:06:05 +0000 (17:06 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun 29 17:06:05 CEST 2012 on sn-devel-104

source3/utils/cclean.c

index d98725e7fb4fcc7c4137ce3ad0987236f39585b6..487c107e472b43574102f578116a2d12acded299 100644 (file)
@@ -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("<no data>\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);
 }