Classic C documentation issue. Are the values that are passed by pointer (p_peer_address and p_whitelist) to sd_ble_gap_adv_start() copied into that function, or do they need to remain valid until advertising stops?
I am assuming the answer is that they are copied, but there's no way to know.
I wish this were encoded into the C language somehow because nobody ever documents it and it must be the source of an unimaginable number of bugs.