From 4344432e9101a1095509cccbb42d19d1bc312663 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Fri, 3 Mar 2017 09:32:49 -0500 Subject: [PATCH] fr_log_fp ,ay be NULL. Closes #1926 --- src/main/radclient.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/radclient.c b/src/main/radclient.c index 7594ed4..80ae279 100644 --- a/src/main/radclient.c +++ b/src/main/radclient.c @@ -977,8 +977,10 @@ static int send_one_packet(rc_request_t *request) return -1; } - fr_packet_header_print(fr_log_fp, request->packet, false); - if (fr_debug_lvl > 0) vp_printlist(fr_log_fp, request->packet->vps); + if (fr_log_fp) { + fr_packet_header_print(fr_log_fp, request->packet, false); + if (fr_debug_lvl > 0) vp_printlist(fr_log_fp, request->packet->vps); + } return 0; } @@ -1087,8 +1089,10 @@ static int recv_one_packet(int wait_time) goto packet_done; } - fr_packet_header_print(fr_log_fp, request->reply, true); - if (fr_debug_lvl > 0) vp_printlist(fr_log_fp, request->reply->vps); + if (fr_log_fp) { + fr_packet_header_print(fr_log_fp, request->reply, true); + if (fr_debug_lvl > 0) vp_printlist(fr_log_fp, request->reply->vps); + } /* * Increment counters... -- 2.1.4