From: Jeff Lenk Date: Thu, 26 May 2011 04:51:48 +0000 (-0500) Subject: fix windows code analysis problems X-Git-Tag: v1.2-rc1~108^2~11^2~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55c24567bdb46b21e1a3e504f9beb3439b8a6586;p=thirdparty%2Ffreeswitch.git fix windows code analysis problems --- diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index 675ecee460..def0346c49 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -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); diff --git a/libs/esl/src/esl_event.c b/libs/esl/src/esl_event.c index 614d1b6190..65dd816369 100644 --- a/libs/esl/src/esl_event.c +++ b/libs/esl/src/esl_event.c @@ -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(); } diff --git a/src/include/switch_event.h b/src/include/switch_event.h index 642e39afeb..4c5a3be931 100644 --- a/src/include/switch_event.h +++ b/src/include/switch_event.h @@ -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)