This is very similar to this question: What happens if stolen software is published as Open Source? – but it doesn't exactly answer my question. This is also a thought experiment with no real companies.
Say there is a company: Acme Corporation. They've released a new IoT device that uses a technology made by the company Foobar Inc.
Cool as they are, Acme Corp. decided to release the whole source code for this new IoT device – including confidential source code from Foobar Inc.
Now, let's say Wile E. Coyote, Acme's most loyal customer, bought this IoT device and downloaded the source that's publicly and officially available on Acme's website, and then Mr. Coyote found the confidential Foobar Inc. source code. Some of the code from Foobar Inc. is under GPL, but others are marked as confidential. Some of the code from Foobar Inc. only has copyright headers, but has no GPL license nor Confidential headers and is also available.
Should Mr. Coyote report this leaked source code to Foobar Inc.? Let's say most of the code is under GPL, should he report it to the Free Software Foundation? Or should he contact Acme Corporation and ask them whether the code that they publicly released was meant to be released?