imrelp: fix regression from very recent commit

Commit 32b71daa8aadb8f16fe0ca2945e54d593f47a824 introduced a
potential misadressing of "inst" during error processing. No
version with that commit was ever released.

Detected by Coverity Scan, CID 190327
This commit is contained in:
Rainer Gerhards 2018-06-25 11:29:05 +02:00
parent 1bcfe083df
commit a78220a933

View File

@ -479,7 +479,7 @@ finalize_it:
BEGINnewInpInst
struct cnfparamvals *pvals;
instanceConf_t *inst;
instanceConf_t *inst = NULL;
int i,j;
FILE *fp;
CODESTARTnewInpInst
@ -609,10 +609,12 @@ finalize_it:
CODE_STD_FINALIZERnewInpInst
cnfparamvalsDestruct(pvals, &inppblk);
if(iRet != RS_RET_OK) {
free(inst->myCertFile);
inst->myCertFile = NULL;
free(inst->myPrivKeyFile);
inst->myPrivKeyFile = NULL;
if(inst != NULL) {
free(inst->myCertFile);
inst->myCertFile = NULL;
free(inst->myPrivKeyFile);
inst->myPrivKeyFile = NULL;
}
}
ENDnewInpInst