bool PublicData::get_value(uint16_t csa, uint16_t csb, uint16_t csc, void *data) {
PublicDataRequest pdr(csa, csb, csc);
- pdr.set_data_ptr(data); // the caller may have put a placeholder for the returned data here
+ // the caller may have created the storage for the returned data so we clear the flag,
+ // if it gets set by the callee setting the data ptr that means the data is a pointer to a pointer and is set to a pointer to the returned data
+ pdr.set_data_ptr(data, false);
THEKERNEL->call_event(ON_GET_PUBLIC_DATA, &pdr );
if(pdr.is_taken() && pdr.has_returned_data()) {
// the callee set the returned data pointer