diff options
-rw-r--r-- | src/libical/icalrestriction.c.in | 25 | ||||
-rw-r--r-- | src/libicalss/icalssyacc.c | 3 |
2 files changed, 19 insertions, 9 deletions
diff --git a/src/libical/icalrestriction.c.in b/src/libical/icalrestriction.c.in index e36773f1..3931fcb0 100644 --- a/src/libical/icalrestriction.c.in +++ b/src/libical/icalrestriction.c.in @@ -331,19 +331,24 @@ static int icalrestriction_check_component(icalproperty_method method, icalcompo assert(compare != -1); if (compare == 0) { -#define TMP_BUF_SIZE 1024 +#if !defined(__COVERITY__) + /* Coverity doesn't think the memory allocated by icalparameter_new_xlicerrortype() + * is freed, even though it should be freed in icalproperty_free() + */ + #define TMP_BUF_SIZE 1024 char temp[TMP_BUF_SIZE]; icalproperty *errProp; - icalparameter *errParam; snprintf(temp, TMP_BUF_SIZE, "Failed iTIP restrictions for %s property. " "Expected %s instances of the property and got %d", icalenum_property_kind_to_string(kind), restr_string_map[restr], count); - errParam = icalparameter_new_xlicerrortype(ICAL_XLICERRORTYPE_INVALIDITIP); - errProp = icalproperty_vanew_xlicerror(temp, errParam, 0); + errProp = + icalproperty_vanew_xlicerror( + temp, icalparameter_new_xlicerrortype(ICAL_XLICERRORTYPE_INVALIDITIP), 0); icalcomponent_add_property(comp, errProp); icalproperty_free(errProp); +#endif } prop = icalcomponent_get_first_property(comp, kind); @@ -353,15 +358,19 @@ static int icalrestriction_check_component(icalproperty_method method, icalcompo } if (funcr != 0) { +#if !defined(__COVERITY__) + /* Coverity doesn't think the memory allocated by icalparameter_new_xlicerrortype() + * is freed, even though it should be freed in icalproperty_free() + */ icalproperty *errProp; - icalparameter *errParam; - errParam = icalparameter_new_xlicerrortype(ICAL_XLICERRORTYPE_INVALIDITIP); - errProp = icalproperty_vanew_xlicerror(funcr, errParam, 0); + errProp = + icalproperty_vanew_xlicerror( + funcr, icalparameter_new_xlicerrortype(ICAL_XLICERRORTYPE_INVALIDITIP), 0); icalcomponent_add_property(comp, errProp); icalproperty_free(errProp); - compare = 0; +#endif } valid = valid && compare; diff --git a/src/libicalss/icalssyacc.c b/src/libicalss/icalssyacc.c index 61b1f502..2416e528 100644 --- a/src/libicalss/icalssyacc.c +++ b/src/libicalss/icalssyacc.c @@ -1317,6 +1317,7 @@ yyparse () YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); + /* coverity[OVERRUN] */ if (yyss + yystacksize - 1 <= yyssp) YYABORT; } @@ -1418,9 +1419,9 @@ yyreduce: users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ + /* coverity[uninit_use] */ yyval = yyvsp[1-yylen]; - YY_REDUCE_PRINT (yyn); switch (yyn) { |