diff options
author | Russell Bryant <russell@russellbryant.com> | 2006-07-16 19:35:09 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2006-07-16 19:35:09 +0000 |
commit | c024569f28bd010810db80ccd7fcc090c075f3cf (patch) | |
tree | 9509e6789b5728b057607153ab7fd31902028cc9 /manager.c | |
parent | 541fdacb3c9e853be2daa7b3871e5ba4b28bd6b8 (diff) |
malloc + memset to ast_calloc
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'manager.c')
-rw-r--r-- | manager.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1909,12 +1909,9 @@ static void *accept_thread(void *ignore) ast_log(LOG_WARNING, "Failed to set manager tcp connection to TCP_NODELAY mode: %s\n", strerror(errno)); } } - s = malloc(sizeof(struct mansession)); - if (!s) { - ast_log(LOG_WARNING, "Failed to allocate management session: %s\n", strerror(errno)); + if (!(s = ast_calloc(1, sizeof(*s)))) continue; - } - memset(s, 0, sizeof(struct mansession)); + memcpy(&s->sin, &sin, sizeof(sin)); s->writetimeout = 100; s->waiting_thread = AST_PTHREADT_NULL; |