diff options
| author | Linus Nordberg <linus@nordu.net> | 2010-10-28 12:49:34 +0200 | 
|---|---|---|
| committer | Linus Nordberg <linus@nordu.net> | 2010-10-28 12:49:34 +0200 | 
| commit | 853447d964506a88956572060f81db43db4d7cd7 (patch) | |
| tree | 889d89c57d77a31cd75bd05be21a26ad4ca7f95b | |
| parent | c62b9e147af51d77089d04de6763916fb76b1a2d (diff) | |
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end."
| -rw-r--r-- | lib/examples/client-blocking.c | 16 | 
1 files changed, 10 insertions, 6 deletions
| 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); | 
