Memory leak: Dynamic allocation from msg_hash_get_help_us_enum was not freed.

This commit is contained in:
Electric Worry 2024-05-20 16:41:53 +01:00 committed by LibretroAdmin
parent e9e5868a8f
commit b630e6b5f9

View File

@ -46,7 +46,11 @@ int msg_hash_get_help_enum(enum msg_hash_enums msg, char *s, size_t len)
"\n", STRLEN_CONST("\n"),
"\n \n", STRLEN_CONST("\n \n"));
strlcpy(s, temp, len);
if (temp)
{
strlcpy(s, temp, len);
free(temp);
}
return ret;
}