mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
fix bugs introduced by previous coverity fixes
This commit is contained in:
parent
389d2ea394
commit
fb00c88763
@ -597,7 +597,7 @@ dumpslices(DCEslice* slice, unsigned int rank)
|
||||
|
||||
buf = ncbytesnew();
|
||||
for(i=0;i<rank;i++,slice++) {
|
||||
String sslice = dumpslice(slice);
|
||||
char* sslice = dumpslice(slice);
|
||||
if(sslice != NULL) {
|
||||
ncbytescat(buf,sslice);
|
||||
free(sslice);
|
||||
|
@ -600,7 +600,7 @@ ncuridecodeparams(NCURI* ncuri)
|
||||
/* plist is an env style list */
|
||||
plist = (char**)calloc(1,sizeof(char*)*(2*nparams+1)); /* +1 for null termination */
|
||||
if(plist == NULL)
|
||||
return NC_ENOMEM;
|
||||
return 0;
|
||||
|
||||
/* Break up each param into a (name,value) pair*/
|
||||
/* and insert into the param list */
|
||||
|
@ -147,7 +147,7 @@ void**
|
||||
oclistdup(OClist* l)
|
||||
{
|
||||
void** result = (void**)malloc(sizeof(void*)*(l->length+1));
|
||||
if(result != NULL && l != NULL && oclistength(l) != 0)
|
||||
if(result != NULL && l != NULL && oclistlength(l) != 0)
|
||||
memcpy((void*)result,(void*)l->content,sizeof(void*)*l->length);
|
||||
result[l->length] = (void*)0;
|
||||
return result;
|
||||
|
@ -599,7 +599,7 @@ ocuridecodeparams(OCURI* ocuri)
|
||||
/* plist is an env style list */
|
||||
plist = (char**)calloc(1,sizeof(char*)*(2*nparams+1)); /* +1 for null termination */
|
||||
if(plist == NULL)
|
||||
return NC_ENOMEM;
|
||||
return 0;
|
||||
|
||||
/* Break up each param into a (name,value) pair*/
|
||||
/* and insert into the param list */
|
||||
|
Loading…
Reference in New Issue
Block a user