mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-02 11:02:28 +02:00
Merge pull request #5290 from neomonkey/master
StringUtil: Fix possible bad free
This commit is contained in:
commit
c55b3a664d
@ -173,7 +173,11 @@ std::string StringFromFormatV(const char* format, va_list args)
|
||||
locale_t previousLocale = uselocale(GetCLocale());
|
||||
#endif
|
||||
if (vasprintf(&buf, format, args) < 0)
|
||||
{
|
||||
ERROR_LOG(COMMON, "Unable to allocate memory for string");
|
||||
buf = nullptr;
|
||||
}
|
||||
|
||||
#if !defined(ANDROID) && !defined(__HAIKU__) && !defined(__OpenBSD__)
|
||||
uselocale(previousLocale);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user