mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-27 06:11:51 +00:00
fix memory leak in linux battery check
This commit is contained in:
parent
be21e30230
commit
ede267805d
@ -794,6 +794,10 @@ static void check_proc_acpi_sysfs_battery(const char *node,
|
||||
else if (strstr((char*)buf, "Full"))
|
||||
*have_battery = true;
|
||||
|
||||
if (buf)
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
|
||||
snprintf(path, sizeof(path), "%s/%s/%s", base, node, "capacity");
|
||||
if (filestream_read_file(path, (void**)&buf, &length) != 1)
|
||||
goto end;
|
||||
|
Loading…
x
Reference in New Issue
Block a user