summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2016-04-29 23:01:32 -0300
committerHisham Muhammad <hisham@gobolinux.org>2016-04-29 23:01:32 -0300
commit2ea4bee66dfe496ee649ecb81245b70554774975 (patch)
treef9f522b9814e953d7901ca438a466a8f9ea55712
parent306c5443ae0aec17c26f194ef624b6c4cc5b30de (diff)
parent1809f4be984bed50e14778c284f2acbe87652e68 (diff)
Merge pull request #486 from mmcco/null-check
Remove needless allocation error conditions
-rw-r--r--darwin/Platform.c8
-rw-r--r--openbsd/Platform.c3
2 files changed, 3 insertions, 8 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c
index 303b6c15..9274d0d8 100644
--- a/darwin/Platform.c
+++ b/darwin/Platform.c
@@ -280,11 +280,9 @@ 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;
- }
+ memcpy(env, p, size);
+ env[size] = 0;
+ env[size+1] = 0;
}
}
free(buf);
diff --git a/openbsd/Platform.c b/openbsd/Platform.c
index 251a7136..9273abc0 100644
--- a/openbsd/Platform.c
+++ b/openbsd/Platform.c
@@ -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) {