summaryrefslogtreecommitdiffstats
path: root/XAlloc.c
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-05-30 12:22:22 -0300
committerHisham <hisham@gobolinux.org>2016-05-30 12:22:22 -0300
commit4674b4a7320bb6b003a4e3b3840027573691e60d (patch)
tree68ec02bfa92ab1b359361991740b9e1e1d06d93a /XAlloc.c
parent7ededce9b5d0d6f8cd24c89ff5d9bbf7da42cd32 (diff)
Stricter strdup.
Diffstat (limited to 'XAlloc.c')
-rw-r--r--XAlloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/XAlloc.c b/XAlloc.c
index 38556987..34a444f2 100644
--- a/XAlloc.c
+++ b/XAlloc.c
@@ -44,8 +44,11 @@ void* xRealloc(void* ptr, size_t size) {
}
char* xStrdup(const char* str) {
+ if (!str) {
+ fail();
+ }
char* data = strdup(str);
- if (!data && str) {
+ if (!data) {
fail();
}
return data;

© 2014-2024 Faster IT GmbH | imprint | privacy policy