From: Timo Sirainen Date: Thu, 30 Mar 2023 11:23:31 +0000 (+0300) Subject: lib: backtrace_append() with libc - Remove dead code X-Git-Tag: 2.4.0~2827 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f719b2e279559c34cd4ed422b084f4a1e382fc5a;p=thirdparty%2Fdovecot%2Fcore.git lib: backtrace_append() with libc - Remove dead code 04d6a2e763bce8640a8192298025d0717e425a66 changed the "out of memory" case to be handled by returning an error instead. This is better than returning unnamed backtrace pointers, which aren't very useful. --- diff --git a/src/lib/backtrace-string.c b/src/lib/backtrace-string.c index 6c458825a3..2f6262969a 100644 --- a/src/lib/backtrace-string.c +++ b/src/lib/backtrace-string.c @@ -93,11 +93,8 @@ static int backtrace_append_libc(string_t *str, const char **error_r) if (str_len(str) > str_orig_size) str_append(str, " -> "); - if (strings == NULL) { - /* out of memory case */ - str_printfa(str, "0x%p", stack[i]); - } else if (str_len(str) != str_orig_size || - !str_begins_with(strings[i], BACKTRACE_SKIP_PREFIX)) { + if (str_len(str) != str_orig_size || + !str_begins_with(strings[i], BACKTRACE_SKIP_PREFIX)) { /* String often contains a full path to the binary, followed by the function name. The path causes the backtrace to be excessively large and we don't