* Do not leak Note::Value::Value::valueFormat.
* Throw if annotation value parsing failures.
Detected by Coverity Scan:
* CID
1399758: Error handling issues (CHECKED_RETURN)
* CID
1399759: Resource leaks (CTOR_DTOR_LEAK)
Note::Value::~Value()
{
aclDestroyAclList(&aclList);
+ delete valueFormat;
}
Note::Value::Value(const char *aVal, const bool quoted, const char *descr, const Method m)
{
if (quoted) {
valueFormat = new Format::Format(descr ? descr : "Notes");
- valueFormat->parse(theValue.c_str());
+ if (!valueFormat->parse(theValue.c_str())) {
+ delete valueFormat;
+ SBuf exceptionMsg;
+ exceptionMsg.Printf("failed to parse annotation value %s", theValue.c_str());
+ throw TexcHere(exceptionMsg.c_str());
+ }
}
}