Merging in a few fixes from Coverity

This commit is contained in:
Ward Fisher 2013-04-02 19:29:26 +00:00
parent a9228fb3ef
commit 98002f5edd
5 changed files with 12 additions and 4 deletions

View File

@ -45,7 +45,7 @@ typedef enum CdTimeUnit {
CdSecond = 8
} CdTimeUnit;
typedef enum cdUnit {
typedef enum cdUnitTime {
cdBadUnit = CdBadTimeUnit,
cdMinute = CdMinute,
cdHour = CdHour,

View File

@ -304,7 +304,7 @@ fprintf(stderr,"conflict: %s[%lu] %s[%lu]\n",
char sindex[64];
snprintf(sindex,sizeof(sindex),"_%d",dim->dim.index1);
dim->ncbasename = (char*)malloc(strlen(sindex)+strlen(legalname)+1);
if(dim->ncbasename == NULL) return NC_ENOMEM;
if(dim->ncbasename == NULL) {nullfree(legalname); return NC_ENOMEM;}
strcpy(dim->ncbasename,legalname);
strcat(dim->ncbasename,sindex);
nullfree(legalname);

View File

@ -1744,9 +1744,11 @@ read_dataset(NC_GRP_INFO_T *grp, const char *obj_name)
return NC_NOERR;
exit:
//exit:
if (access_pid && H5Pclose(access_pid) < 0)
BAIL2(retval);
#ifdef EXTRA_TESTS
num_plists--;
#endif
@ -1757,6 +1759,8 @@ read_dataset(NC_GRP_INFO_T *grp, const char *obj_name)
#ifdef EXTRA_TESTS
num_spaces--;
#endif
exit:
if(dims) free(dims);
if(max_dims) free(max_dims);

View File

@ -497,8 +497,11 @@ nc4_find_dim_len(NC_GRP_INFO_T *grp, int dimid, size_t **len)
/* Find dimensions of this var. */
if ((retval = find_var_shape_grp(grp, var->varid, &ndims,
dimids, dimlen)))
dimids, dimlen))) {
free(dimids);
free(dimlen);
return retval;
}
/* Check for any dimension that matches dimid. If found, check
* if its length is longer than *lenp. */

View File

@ -878,6 +878,7 @@ copy_vars(int igrp, int ogrp)
continue;
NC_CHECK(copy_var(igrp, varid, ogrp));
}
free(vlist);
return stat;
}