]> code.citadel.org Git - citadel.git/blobdiff - citadel/event_client.c
Backtrace: check for NULL pointer argument.
[citadel.git] / citadel / event_client.c
index d0e0fd9aefe9f20295a8827fda8fb5dabcf3f26b..927e18bd0d75a440807219a587dbc47653400737 100644 (file)
@@ -983,14 +983,17 @@ void EV_backtrace(AsyncIO *IO)
        size_t size, i;
        char **strings;
 
-
+       if (IO == NULL)
+               return;
        size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
        strings = backtrace_symbols(stack_frames, size);
        for (i = 0; i < size; i++) {
-               if (strings != NULL)
+               if (strings != NULL) {
                        EV_syslog(LOG_ALERT, " BT %s\n", strings[i]);
-               else
+               }
+               else {
                        EV_syslog(LOG_ALERT, " BT %p\n", stack_frames[i]);
+               }
        }
        free(strings);
 #endif