Index: main/manager.c =================================================================== --- main/manager.c (revision 93948) +++ main/manager.c (working copy) @@ -2265,6 +2265,13 @@ struct mansession *s = data; int res; + /* If the entire session occurs in a single context switch, then it's + * possible to get an unsafe memory condition by free()ing the memory + * before letting other threads run at least once. This actually seems + * like a workaround for a glibc bug. + */ + usleep(1); + astman_append(s, "Asterisk Call Manager/1.0\r\n"); for (;;) { if ((res = do_message(s)) < 0)