]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: backtrace_append() with libc - Remove dead code
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 30 Mar 2023 11:23:31 +0000 (14:23 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 31 Mar 2023 07:54:10 +0000 (07:54 +0000)
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.

src/lib/backtrace-string.c

index 6c458825a3dbab5a4dce952edb67b2be0e17b819..2f6262969ad8db9c243e14e3b89c35bf14c2e1f3 100644 (file)
@@ -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