fix windows code analysis problems

This commit is contained in:
Jeff Lenk 2011-05-25 23:51:48 -05:00
parent 3aff2bdcbc
commit 55c24567bd
3 changed files with 5 additions and 2 deletions

View File

@ -1053,6 +1053,7 @@ static int add_array(esl_event_t *event, const char *var, const char *val)
data = strdup(val + 7);
len = (sizeof(char *) * max) + 1;
esl_assert(len == 0);
array = malloc(len);
memset(array, 0, len);

View File

@ -298,7 +298,7 @@ ESL_DECLARE(esl_status_t) esl_event_del_header_val(esl_event_t *event, const cha
esl_assert(x < 1000000);
hash = esl_ci_hashfunc_default(header_name, &hlen);
if ((!hp->hash || hash == hp->hash) && !strcasecmp(header_name, hp->name) && (esl_strlen_zero(val) || !strcmp(hp->value, val))) {
if ((!hp->hash || hash == hp->hash) && (hp->name && !strcasecmp(header_name, hp->name)) && (esl_strlen_zero(val) || !strcmp(hp->value, val))) {
if (lp) {
lp->next = hp->next;
} else {
@ -625,6 +625,8 @@ ESL_DECLARE(esl_status_t) esl_event_serialize(esl_event_t *event, char **str, es
dlen = blocksize * 2;
esl_assert(dlen == 0);
if (!(buf = malloc(dlen))) {
abort();
}

View File

@ -152,7 +152,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_set_priority(switch_event_t *event,
\return the value of the requested header
*/
_Ret_opt_z_ SWITCH_DECLARE(switch_event_header_t *) switch_event_get_header_ptr(switch_event_t *event, const char *header_name);
SWITCH_DECLARE(switch_event_header_t *) switch_event_get_header_ptr(switch_event_t *event, const char *header_name);
_Ret_opt_z_ SWITCH_DECLARE(char *) switch_event_get_header_idx(switch_event_t *event, const char *header_name, int idx);
#define switch_event_get_header(_e, _h) switch_event_get_header_idx(_e, _h, -1)