From 853447d964506a88956572060f81db43db4d7cd7 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 28 Oct 2010 12:49:34 +0200 Subject: "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end." --- lib/examples/client-blocking.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/examples') diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c index 365b3b0..39792b7 100644 --- a/lib/examples/client-blocking.c +++ b/lib/examples/client-blocking.c @@ -21,8 +21,6 @@ blocking_client (const char *av1, const char *av2) struct rs_context *h; struct rs_connection *conn; struct rs_packet *req, *resp; - RADIUS_PACKET *fr_pkt; - VALUE_PAIR *fr_vp; if (rs_context_create (&h, "/usr/share/freeradius/dictionary")) return NULL; @@ -77,10 +75,16 @@ blocking_client (const char *av1, const char *av2) } #endif /* !defined(USE_REQUEST_OBJECT) */ - fr_pkt = rs_packet_frpkt (resp); - fr_vp = fr_pkt->vps; /* FIXME: Is there an accessor? */ - vp_printlist(stdout, fr_vp); - rs_packet_destroy (resp); + if (resp) + { + RADIUS_PACKET *fr_pkt; + VALUE_PAIR *fr_vp; + + fr_pkt = rs_packet_frpkt (resp); + fr_vp = fr_pkt->vps; /* FIXME: Is there an accessor? */ + vp_printlist(stdout, fr_vp); + rs_packet_destroy (resp); + } rs_conn_destroy (conn); rs_context_destroy (h); -- cgit v1.1