aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-12-10 21:20:48 +0100
committerMattias Andrée <maandree@kth.se>2021-12-10 21:23:29 +0100
commit6f221af77aa5aff04907e70f45bc1859a8e1cb19 (patch)
tree5459d25c0f3e306109f7a074dc3fb0f20d149331
parentFix unsetenv (diff)
downloadliberror-libc-6f221af77aa5aff04907e70f45bc1859a8e1cb19.tar.gz
liberror-libc-6f221af77aa5aff04907e70f45bc1859a8e1cb19.tar.bz2
liberror-libc-6f221af77aa5aff04907e70f45bc1859a8e1cb19.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--strdup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/strdup.c b/strdup.c
index 0b1c8ee..4c55c66 100644
--- a/strdup.c
+++ b/strdup.c
@@ -5,7 +5,7 @@
void
liberror_strdup_failed(const char *s)
{
- liberror_set_error_errno(errno == ENOMEM ? "Out of memory" : "", "strdup", errno);
+ liberror_set_error_errno("", "strdup", errno);
(void) s;
}
@@ -13,7 +13,7 @@ liberror_strdup_failed(const char *s)
char *
liberror_strdup(const char *s)
{
- char *ret = malloc(s);
+ char *ret = strdup(s);
if (ret)
return ret;
liberror_save_backtrace(NULL);