gcry crypto provider: improve error reporting

plus some truely cosmetic-only changes to silence Coverity scan.
This commit is contained in:
Rainer Gerhards 2017-11-12 11:55:33 +01:00
parent 579fb0a9f8
commit 6839cd5cb6
4 changed files with 9 additions and 13 deletions

View File

@ -1038,7 +1038,7 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
/* check if a non-standard template is to be applied */
if(*(p-1) == ';')
--p;
CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, 0, (uchar*) "RSYSLOG_FileFormat"));
iRet = cflineParseTemplateName(&p, *ppOMSR, 0, 0, (uchar*) "RSYSLOG_FileFormat");
CODE_STD_FINALIZERparseSelectorAct
ENDparseSelectorAct
@ -1056,8 +1056,7 @@ BEGINmodExit
CODESTARTmodExit
free(cs.szBinary);
cs.szBinary = NULL;
CHKiRet(objRelease(errmsg, CORE_COMPONENT));
finalize_it:
iRet = objRelease(errmsg, CORE_COMPONENT);
ENDmodExit

View File

@ -241,12 +241,11 @@ OnFileOpen(void *pT, uchar *fn, void *pGF, char openMode)
DEFiRet;
DBGPRINTF("lmcry_gcry: open file '%s', mode '%c'\n", fn, openMode);
CHKiRet(rsgcryInitCrypt(pThis->ctx, pgf, fn, openMode));
finalize_it:
/* TODO: enable this error message (need to cleanup loop first ;))
errmsg.LogError(0, iRet, "Encryption Provider"
"Error: cannot open .encinfo file - disabling log file");
*/
iRet = rsgcryInitCrypt(pThis->ctx, pgf, fn, openMode);
if(iRet != RS_RET_OK) {
errmsg.LogError(0, iRet, "Encryption Provider"
"Error: cannot open .encinfo file - disabling log file");
}
RETiRet;
}

View File

@ -127,8 +127,7 @@ netstrmsConstructFinalize(netstrms_t *pThis)
{
DEFiRet;
ISOBJ_TYPE_assert(pThis, netstrms);
CHKiRet(loadDrvr(pThis));
finalize_it:
iRet = loadDrvr(pThis);
RETiRet;
}

View File

@ -255,8 +255,7 @@ addCounter(statsobj_t *pThis, const uchar *ctrName, statsCtrType_t ctrType, int8
{
ctr_t *ctr;
DEFiRet;
CHKiRet(addManagedCounter(pThis, ctrName, ctrType, flags, pCtr, &ctr, 1));
finalize_it:
iRet = addManagedCounter(pThis, ctrName, ctrType, flags, pCtr, &ctr, 1);
RETiRet;
}