mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Check for failure in allocations.
This commit is contained in:
@ -50,7 +50,7 @@ static unsigned long int parseBatInfo(const char *fileName, const unsigned short
|
||||
char* entryName = dirEntry->d_name;
|
||||
if (strncmp(entryName, "BAT", 3))
|
||||
continue;
|
||||
batteries[nBatteries] = strdup(entryName);
|
||||
batteries[nBatteries] = xStrdup(entryName);
|
||||
nBatteries++;
|
||||
}
|
||||
closedir(batteryDir);
|
||||
|
Reference in New Issue
Block a user