From 3bc1fa7833f021604074aaa7a53cdca34be34d5f Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 4 Feb 2011 13:59:19 +0100 Subject: Initialize pointer in example program before trusting it. --- lib/examples/client-blocking.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/examples') diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c index 21d40d8..def0068 100644 --- a/lib/examples/client-blocking.c +++ b/lib/examples/client-blocking.c @@ -18,7 +18,7 @@ blocking_client (const char *av1, const char *av2, int use_request_object_flag) { struct rs_context *h; struct rs_connection *conn; - struct rs_packet *req, *resp; + struct rs_packet *req, *resp = NULL; if (rs_context_create (&h, "/usr/share/freeradius/dictionary")) return NULL; @@ -76,12 +76,13 @@ blocking_client (const char *av1, const char *av2, int use_request_object_flag) if (resp) { - RADIUS_PACKET *fr_pkt; - VALUE_PAIR *fr_vp; + RADIUS_PACKET *fr_pkt = NULL; + VALUE_PAIR *fr_vp = NULL; fr_pkt = rs_packet_frpkt (resp); - fr_vp = fr_pkt->vps; /* FIXME: Is there an accessor? */ - vp_printlist(stdout, fr_vp); + fr_vp = fr_pkt->vps; /* FIXME: Is there an accessor? */ + if (fr_vp) + vp_printlist(stdout, fr_vp); rs_packet_destroy (resp); } -- cgit v1.1