Fixes to Coverity issues 72736 & 72735

This commit is contained in:
VilhoRaatikka
2014-11-06 08:45:46 +02:00
parent 665315ea5c
commit f44ed2f3b4

View File

@ -216,7 +216,6 @@ int skygw_rwlock_destroy(
} }
/** Clean the struct */ /** Clean the struct */
rwlock->srw_rwlock_thr = 0; rwlock->srw_rwlock_thr = 0;
rwlock->srw_rwlock = NULL;
/** Unlock */ /** Unlock */
pthread_rwlock_unlock(rwlock->srw_rwlock); pthread_rwlock_unlock(rwlock->srw_rwlock);
/** Destroy */ /** Destroy */
@ -227,6 +226,10 @@ int skygw_rwlock_destroy(
err, err,
strerror(err)); strerror(err));
} }
else
{
rwlock->srw_rwlock = NULL;
}
retblock: retblock:
return err; return err;
} }
@ -1898,13 +1901,15 @@ void skygw_file_done(
fprintf(stderr, fprintf(stderr,
"* Closing file %s failed : %s.\n", "* Closing file %s failed : %s.\n",
file->sf_fname, file->sf_fname,
strerror(err)); strerror(errno));
} }
ss_dassert(err == 0); else
{
ss_dfprintf(stderr, "Closed %s\n", file->sf_fname); ss_dfprintf(stderr, "Closed %s\n", file->sf_fname);
free(file->sf_fname); free(file->sf_fname);
free(file); free(file);
} }
}
} }