Working with uint8_t*

Because I don't know what I'm doing and this finally worked. I mean... I'm really grateful for what all you knowledgeable guys are doing here... but I'm not too clear on what I could have done to avoid creating such a long thread for such a simple issue that still doesn't seem to contain a good solution.

This said, I'm not just looking for quick fixes and want to learn. From the little I understand, static memory allocation is called that because the memory is reserved at compile time. Wouldn't that mean I'd have to initialize "wifi_scan_config_t config" somewhere outside the function?