mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Merging in a few fixes from Coverity
This commit is contained in:
parent
a9228fb3ef
commit
98002f5edd
@ -45,7 +45,7 @@ typedef enum CdTimeUnit {
|
||||
CdSecond = 8
|
||||
} CdTimeUnit;
|
||||
|
||||
typedef enum cdUnit {
|
||||
typedef enum cdUnitTime {
|
||||
cdBadUnit = CdBadTimeUnit,
|
||||
cdMinute = CdMinute,
|
||||
cdHour = CdHour,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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. */
|
||||
|
@ -878,6 +878,7 @@ copy_vars(int igrp, int ogrp)
|
||||
continue;
|
||||
NC_CHECK(copy_var(igrp, varid, ogrp));
|
||||
}
|
||||
free(vlist);
|
||||
return stat;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user