Commit 4674b4a7 authored by Hisham's avatar Hisham
Browse files

Stricter strdup.

parent 7ededce9
...@@ -44,8 +44,11 @@ void* xRealloc(void* ptr, size_t size) { ...@@ -44,8 +44,11 @@ void* xRealloc(void* ptr, size_t size) {
} }
char* xStrdup(const char* str) { char* xStrdup(const char* str) {
if (!str) {
fail();
}
char* data = strdup(str); char* data = strdup(str);
if (!data && str) { if (!data) {
fail(); fail();
} }
return data; return data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment