fr_log_fp ,ay be NULL. Closes #1926
authorAlan T. DeKok <aland@freeradius.org>
Fri, 3 Mar 2017 14:32:49 +0000 (09:32 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 3 Mar 2017 14:32:49 +0000 (09:32 -0500)
src/main/radclient.c

index 7594ed4..80ae279 100644 (file)
@@ -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...