diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-26 20:43:38 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-26 20:43:38 +0000 |
commit | db029c0ce2d9f4ad2a739ce7b34faddd44cd0432 (patch) | |
tree | f26314d4c8ff4bcb8590905540b19db8cf24f899 /main/manager.c | |
parent | a32e16463c51393eea3f59f0458372a34b4ce2b8 (diff) |
Workaround for what is probably a glibc bug (but we'll see this crop up again
and again, if we don't add the workaround).
Reported by: rolek
Patch by: tilghman
(Closes issue #11601, closes issue #11426)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@94808 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/manager.c')
-rw-r--r-- | main/manager.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/manager.c b/main/manager.c index 830634792..6d7cc3fc1 100644 --- a/main/manager.c +++ b/main/manager.c @@ -2283,6 +2283,14 @@ static void *session_do(void *data) } ast_log(LOG_EVENT, "Failed attempt from %s\n", ast_inet_ntoa(s->sin.sin_addr)); } + + /* 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); + destroy_session(s); return NULL; } |