Message ID | 20220221084909.463671717@linuxfoundation.org (mailing list archive) |
---|---|
State | Mainlined |
Commit | 52a9dab6d892763b2a8334a568bd4e2c1a6fde66 |
Headers | show |
Series | None | expand |
--- a/tools/lib/subcmd/subcmd-util.h +++ b/tools/lib/subcmd/subcmd-util.h @@ -49,15 +49,8 @@ static NORETURN inline void die(const ch static inline void *xrealloc(void *ptr, size_t size) { void *ret = realloc(ptr, size); - if (!ret && !size) - ret = realloc(ptr, 1); - if (!ret) { - ret = realloc(ptr, size); - if (!ret && !size) - ret = realloc(ptr, 1); - if (!ret) - die("Out of memory, realloc failed"); - } + if (!ret) + die("Out of memory, realloc failed"); return ret; }