Resolve some coverity warnings
This commit is contained in:
@@ -313,8 +313,10 @@ _DtCm_check_cal_csa_attributes(
|
||||
&realnum)) != CSA_SUCCESS)
|
||||
return (stat);
|
||||
|
||||
if (checkattrnum == B_TRUE && realnum == 0)
|
||||
if (checkattrnum == B_TRUE && realnum == 0) {
|
||||
free(hattrs);
|
||||
return (CSA_E_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
stat = _DtCm_check_hashed_cal_attributes(fvers, hnum, hattrs,
|
||||
NULL, cname, checkreadonly, firsttime, B_TRUE);
|
||||
@@ -344,8 +346,10 @@ _DtCm_check_cal_cms_attributes(
|
||||
&realnum)) != CSA_SUCCESS)
|
||||
return (stat);
|
||||
|
||||
if (checkattrnum == B_TRUE && realnum == 0)
|
||||
if (checkattrnum == B_TRUE && realnum == 0) {
|
||||
free(hattrs);
|
||||
return (CSA_E_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
stat = _DtCm_check_hashed_cal_attributes(fvers, hnum, hattrs,
|
||||
owner, cname, checkreadonly, firsttime, B_FALSE);
|
||||
@@ -372,8 +376,10 @@ _DtCm_check_entry_attributes(
|
||||
&realnum)) != CSA_SUCCESS)
|
||||
return (stat);
|
||||
|
||||
if (checkattrnum == B_TRUE && realnum == 0)
|
||||
if (checkattrnum == B_TRUE && realnum == 0) {
|
||||
free(hattrs);
|
||||
return (CSA_E_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
stat = _DtCm_check_hashed_entry_attributes(fvers, hnum, hattrs,
|
||||
utype);
|
||||
@@ -400,8 +406,10 @@ _DtCm_check_entry_cms_attributes(
|
||||
&realnum)) != CSA_SUCCESS)
|
||||
return (stat);
|
||||
|
||||
if (checkattrnum == B_TRUE && realnum == 0)
|
||||
if (checkattrnum == B_TRUE && realnum == 0) {
|
||||
free(hattrs);
|
||||
return (CSA_E_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
stat = _DtCm_check_hashed_entry_attributes(fvers, hnum, hattrs,
|
||||
utype);
|
||||
@@ -1184,10 +1192,12 @@ _DtCm_free_csa_access_list(CSA_access_list alist)
|
||||
nptr = alist->next;
|
||||
|
||||
if (alist->user) {
|
||||
if (alist->user->user_name)
|
||||
if (alist->user->user_name) {
|
||||
free(alist->user->user_name);
|
||||
if (alist->user->calendar_address);
|
||||
}
|
||||
if (alist->user->calendar_address) {
|
||||
free(alist->user->calendar_address);
|
||||
}
|
||||
free(alist->user);
|
||||
}
|
||||
|
||||
|
||||
@@ -299,8 +299,10 @@ _DtCm_list_old_cal_attr_names(
|
||||
return (CSA_E_INSUFFICIENT_MEMORY);
|
||||
|
||||
/* find out whether we know the owner of the calendar */
|
||||
if ((stat = _get_owner_from_old_cal(cal, buf)) != CSA_SUCCESS)
|
||||
if ((stat = _get_owner_from_old_cal(cal, buf)) != CSA_SUCCESS) {
|
||||
_DtCm_free(names);
|
||||
return (stat);
|
||||
}
|
||||
|
||||
for (i = 1, j = 0; i <= _DtCM_DEFINED_CAL_ATTR_SIZE; i++) {
|
||||
if (_CSA_cal_attr_info[i].fst_vers > 0 &&
|
||||
|
||||
@@ -85,8 +85,11 @@ _DtCmIsSameUser(char *user1, char *user2)
|
||||
str1 = _DtCmGetPrefix(user1, '@');
|
||||
str2 = _DtCmGetPrefix(user2, '@');
|
||||
|
||||
if (str1 == NULL || str2 == NULL)
|
||||
if (str1 == NULL || str2 == NULL) {
|
||||
free(str1);
|
||||
free(str2);
|
||||
return (B_FALSE);
|
||||
}
|
||||
|
||||
if (strcmp(str1, str2)) {
|
||||
free(str1);
|
||||
|
||||
@@ -926,8 +926,10 @@ DeriveDailyEvent(
|
||||
/* Convert from list to array, sort */
|
||||
dd->dd_time = (Time *)ConvertNumList(time_list, &(dd->dd_ntime));
|
||||
|
||||
if (interval < 1)
|
||||
if (interval < 1) {
|
||||
free(dd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
re = (RepeatEvent *)calloc(1, sizeof(RepeatEvent));
|
||||
|
||||
@@ -963,8 +965,10 @@ DeriveWeeklyEvent(
|
||||
/* Convert from list to array, sort */
|
||||
wd->wd_daytime = ConvertDayTime(dtl, &(wd->wd_ndaytime));
|
||||
|
||||
if (interval < 1)
|
||||
if (interval < 1) {
|
||||
free(wd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
re = (RepeatEvent *)calloc(1, sizeof(RepeatEvent));
|
||||
|
||||
@@ -1006,8 +1010,10 @@ DeriveMonthlyEvent(
|
||||
(NumberList *)data_list, &(md->md_nitems));
|
||||
}
|
||||
|
||||
if (interval < 1)
|
||||
if (interval < 1) {
|
||||
free(md);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
re = (RepeatEvent *)calloc(1, sizeof(RepeatEvent));
|
||||
|
||||
@@ -1044,8 +1050,10 @@ DeriveYearlyEvent(
|
||||
/* Convert from list to array, sort */
|
||||
yd->yd_items = ConvertNumList(nl, &(yd->yd_nitems));
|
||||
|
||||
if (interval < 1)
|
||||
if (interval < 1) {
|
||||
free(yd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
re = (RepeatEvent *)calloc(1, sizeof(RepeatEvent));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user