mirror of https://gitee.com/bigwinds/arangodb
free bind parameters memory
This commit is contained in:
parent
d08f45d778
commit
e074ed1e2a
|
@ -100,6 +100,34 @@ bool TRI_EqualBindParameterAql (TRI_associative_pointer_t* array,
|
|||
return TRI_EqualString(key, parameter->_name);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief free bind parameters
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_FreeBindParametersAql (TRI_aql_parse_context_t* const context) {
|
||||
size_t i;
|
||||
size_t n;
|
||||
|
||||
// iterate thru all parameters allocated
|
||||
n = context->_parameterValues._nrAlloc;
|
||||
for (i = 0; i < n; ++i) {
|
||||
TRI_aql_bind_parameter_t* parameter;
|
||||
|
||||
parameter = (TRI_aql_bind_parameter_t*) context->_parameterValues._table[i];
|
||||
|
||||
if (!parameter) {
|
||||
continue;
|
||||
}
|
||||
|
||||
assert(parameter->_name);
|
||||
assert(parameter->_value);
|
||||
|
||||
TRI_FreeString(parameter->_name);
|
||||
TRI_FreeJson(parameter->_value);
|
||||
TRI_Free(parameter);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief add bind parameters
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -87,6 +87,12 @@ bool TRI_EqualBindParameterAql (TRI_associative_pointer_t*,
|
|||
void const*,
|
||||
void const*);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief free bind parameters
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_FreeBindParametersAql (TRI_aql_parse_context_t* const);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief add bind parameters
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -204,6 +204,7 @@ void TRI_FreeParseContextAql (TRI_aql_parse_context_t* const context) {
|
|||
TRI_DestroyAssociativePointer(&context->_parameterNames);
|
||||
|
||||
// free parameter values
|
||||
TRI_FreeBindParametersAql(context);
|
||||
TRI_DestroyAssociativePointer(&context->_parameterValues);
|
||||
|
||||
// free query string
|
||||
|
|
Loading…
Reference in New Issue