mirror of https://github.com/xzeldon/htop.git
Remove needless allocation error conditions
These allocations were converted to use xMalloc et al. and no longer need error checks.
This commit is contained in:
parent
306c5443ae
commit
1809f4be98
|
@ -280,13 +280,11 @@ char* Platform_getProcessEnv(pid_t pid) {
|
|||
|
||||
size_t size = endp - p;
|
||||
env = xMalloc(size+2);
|
||||
if (env) {
|
||||
memcpy(env, p, size);
|
||||
env[size] = 0;
|
||||
env[size+1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -265,9 +265,6 @@ void Platform_setSwapValues(Meter* this) {
|
|||
}
|
||||
|
||||
swdev = xCalloc(nswap, sizeof(*swdev));
|
||||
if (swdev == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
rnswap = swapctl(SWAP_STATS, swdev, nswap);
|
||||
if (rnswap == -1) {
|
||||
|
|
Loading…
Reference in New Issue