core/template: fix double free due to 9e3efd4960eb6133c99b0842e5a717ba37b5cda1

Fix 9e3efd4960eb6133c99b0842e5a717ba37b5cda1 was incomplete, causing
a double-free.

Detected by Coverity scan, CID 185476
This commit is contained in:
Rainer Gerhards 2017-10-30 09:40:16 +01:00
parent f2cdef10c5
commit 72496ac8b4

View File

@ -178,8 +178,6 @@ tplToString(struct template *__restrict__ const pTpl,
if(iLenVal >= (rs_size_t)iparam->lenBuf) /* we reserve one char for the final \0! */
CHKiRet(ExtendBuf(iparam, iLenVal + 1));
memcpy(iparam->param, pVal, iLenVal+1);
if(bMustBeFreed)
free(pVal);
FINALIZE;
}