[dovecot-cvs] dovecot/src/lib backtrace-string.c,1.1.2.1,1.1.2.2

tss at dovecot.org tss at dovecot.org
Sun Nov 19 13:36:36 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv27529

Modified Files:
      Tag: branch_1_0
	backtrace-string.c 
Log Message:
Handle backtrace_symbols() returning NULL without errors (out of memory).



Index: backtrace-string.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/backtrace-string.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- backtrace-string.c	19 Nov 2006 13:30:35 -0000	1.1.2.1
+++ backtrace-string.c	19 Nov 2006 13:36:34 -0000	1.1.2.2
@@ -26,7 +26,13 @@
 	for (i = STACK_SKIP_COUNT; i < ret; i++) {
 		if (i > STACK_SKIP_COUNT)
 			str_append(str, " -> ");
-		str_append(str, strings[i]);
+
+		if (strings != NULL)
+			str_append(str, strings[i]);
+		else {
+			/* out of memory case */
+			str_printfa(str, "0x%p", stack[i]);
+		}
 	}
 	free(strings);
 	return 0;



More information about the dovecot-cvs mailing list