Add missing asserts and move temp mem context block.
@@ -177,9 +177,12 @@ protocolClientError(ProtocolClient *const this, const ProtocolMessageType type,
FUNCTION_LOG_PARAM(PACK_READ, error);
FUNCTION_LOG_END();
- MEM_CONTEXT_TEMP_BEGIN()
- {
+ ASSERT(this != NULL);
+ ASSERT(error != NULL);
+
if (type == protocolMessageTypeError)
+ {
+ MEM_CONTEXT_TEMP_BEGIN()
{
const ErrorType *const type = errorTypeFromCode(pckReadI32P(error));
const String *const message = strNewFmt("%s: %s", strZ(this->errorPrefix), strZ(pckReadStrP(error)));
@@ -190,8 +193,8 @@ protocolClientError(ProtocolClient *const this, const ProtocolMessageType type,
errorInternalThrow(type, __FILE__, __func__, __LINE__, strZ(message), strZ(stack));
}
- }
MEM_CONTEXT_TEMP_END();
+ }
FUNCTION_LOG_RETURN_VOID();
}
@@ -204,6 +207,8 @@ protocolClientDataGet(ProtocolClient *const this)
FUNCTION_LOG_PARAM(PROTOCOL_CLIENT, this);
FUNCTION_LOG_END();
+ ASSERT(this != NULL);
+
PackRead *result = NULL;
MEM_CONTEXT_TEMP_BEGIN()
@@ -236,6 +241,8 @@ protocolClientDataEndGet(ProtocolClient *const this)
FUNCTION_LOG_PARAM(PROTOCOL_CLIENT, this);
FUNCTION_LOG_END();
+ ASSERT(this != NULL);
+
MEM_CONTEXT_TEMP_BEGIN()
{
PackRead *response = pckReadNewIo(this->pub.read);
