Index: cdr_addon_mysql.c =================================================================== --- cdr_addon_mysql.c (revision 473) +++ cdr_addon_mysql.c (working copy) @@ -212,15 +212,15 @@ mysql_escape_string(uniqueid, cdr->uniqueid, strlen(cdr->uniqueid)); if (userfield && ((userfielddata = alloca(strlen(cdr->userfield) * 2 + 1)) != NULL)) mysql_escape_string(userfielddata, cdr->userfield, strlen(cdr->userfield)); - if (src && ((src = alloca(strlen(cdr->src) * 2 + 1)) != NULL)) + if ((src = alloca(strlen(cdr->src) * 2 + 1)) != NULL) mysql_escape_string(src, cdr->src, strlen(cdr->src)); - if (dst && ((dst = alloca(strlen(cdr->dst) * 2 + 1)) != NULL)) + if ((dst = alloca(strlen(cdr->dst) * 2 + 1)) != NULL) mysql_escape_string(dst, cdr->dst, strlen(cdr->dst)); - if (accountcode && ((accountcode = alloca(strlen(cdr->accountcode) * 2 + 1)) != NULL)) + if ((accountcode = alloca(strlen(cdr->accountcode) * 2 + 1)) != NULL) mysql_escape_string(accountcode, cdr->accountcode, strlen(cdr->accountcode)); /* Check for all alloca failures above at once */ - if ((!clid) || (!dcontext) || (!channel) || (!dstchannel) || (!lastapp) || (!lastdata) || (!src) || (!dst) || (!accountcode) || (loguniqueid && !uniqueid)) { + if ((!clid) || (!dcontext) || (!channel) || (!dstchannel) || (!lastapp) || (!lastdata) || (!src) || (!dst) || (!accountcode) || (loguniqueid && !uniqueid) || (userfield && !userfielddata)) { ast_log(LOG_ERROR, "cdr_mysql: Out of memory error (insert fails)\n"); ast_mutex_unlock(&mysql_lock); return -1;