Move NULL checks to start of functions

This commit is contained in:
Stuart Reilly
2019-06-28 16:08:36 +01:00
parent bc1b4885de
commit d8ec0a9229
2 changed files with 35 additions and 22 deletions
+8
View File
@@ -41,7 +41,15 @@ static void ndpi_int_eaq_add_connection(struct ndpi_detection_module_struct *ndp
void ndpi_search_eaq(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
if (!flow) {
return;
}
struct ndpi_packet_struct *packet = &flow->packet;
if (!packet) {
return;
}
u_int16_t sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
NDPI_LOG_DBG(ndpi_struct, "search eaq\n");