diff options
author | Michael McConville <mmcco@mykolab.com> | 2016-04-29 21:10:05 -0400 |
---|---|---|
committer | Michael McConville <mmcco@mykolab.com> | 2016-04-29 21:10:05 -0400 |
commit | 1809f4be984bed50e14778c284f2acbe87652e68 (patch) | |
tree | f9f522b9814e953d7901ca438a466a8f9ea55712 | |
parent | 306c5443ae0aec17c26f194ef624b6c4cc5b30de (diff) |
Remove needless allocation error conditions
These allocations were converted to use xMalloc et al. and no longer
need error checks.
-rw-r--r-- | darwin/Platform.c | 8 | ||||
-rw-r--r-- | openbsd/Platform.c | 3 |
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) { |