mirror of https://github.com/xzeldon/htop.git
Stricter strdup.
This commit is contained in:
parent
7ededce9b5
commit
4674b4a732
5
XAlloc.c
5
XAlloc.c
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue