Fix cherry-pick test case.

This commit is contained in:
Marcello Stanisci 2018-09-25 19:08:11 +02:00
parent dd29898617
commit a5dde6ea46
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F

View File

@ -2091,6 +2091,20 @@ TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
? krd->response_compressed
: krd->response_uncompressed);
TEH_KS_release (key_state);
/**
* Not the best style, but needed since the logic has this
* dual behaviour: some functions touch directly the global
* variable, some others want the key state passed in the
* arguments.
*
* NOTE, this NULL-ification is needed because otherwise
* the internal key state object gets left with refcnt == 0
* and a non-NULL global pointer to it.
*/
if (internal_key_state == key_state)
internal_key_state = NULL;
return ret;
}