From 6f221af77aa5aff04907e70f45bc1859a8e1cb19 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 10 Dec 2021 21:20:48 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- strdup.c | 4 ++-- 1 file 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); -- cgit v1.2.3-70-g09d2