From: Jonathan Rose Date: Wed, 4 Apr 2012 19:52:05 +0000 (+0000) Subject: Fix some stuff involving calls to memcpy and memset X-Git-Tag: 1.8.13.0-rc1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78e9a8e5f00d4425e6b77f05fe006c024d512919;p=thirdparty%2Fasterisk.git Fix some stuff involving calls to memcpy and memset The important parts of the patch were already applied through other updates. (closes issue ASTERISK-19445) Reported by: Makoto Dei Patches: memset-memcpy-length.patch uploaded by Makoto Dei (license 5027) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361210 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/addons/ooh323cDriver.c b/addons/ooh323cDriver.c index f8621aa877..d964898350 100644 --- a/addons/ooh323cDriver.c +++ b/addons/ooh323cDriver.c @@ -145,14 +145,13 @@ int ooh323c_start_call_thread(ooCallData *call) { /* make new thread */ if (cur == NULL) { - if (!(cur = ast_malloc(sizeof(struct callthread)))) { + if (!(cur = ast_calloc(1, sizeof(struct callthread)))) { ast_log(LOG_ERROR, "Unable to allocate thread structure for call %s\n", call->callToken); return -1; } ast_module_ref(myself); - memset(cur, 0, sizeof(cur)); if ((socketpair(PF_LOCAL, SOCK_STREAM, 0, cur->thePipe)) == -1) { ast_log(LOG_ERROR, "Can't create thread pipe for call %s\n", call->callToken); free(cur);