P2P: Fix NULL pointer dereference with SD query cancellation
[mech_eap.git] / src / p2p / p2p.c
index 77bd7fc..418687a 100644 (file)
@@ -2847,7 +2847,7 @@ static void p2p_sd_cb(struct p2p_data *p2p, int success)
                return;
        }
 
-       if (p2p->sd_query->for_all_peers) {
+       if (p2p->sd_query && p2p->sd_query->for_all_peers) {
                /* Update the pending broadcast SD query count for this device
                 */
                p2p->sd_peer->sd_pending_bcast_queries--;