--- /dev/null
+ o Minor bugfixes (memory management, testing):
+ - Stop leaking parts of the shared random state in the shared-random unit
+ tests. The previous fix in 29599 was incomplete.
+ Fixes bug 29706; bugfix on 0.2.9.1-alpha.
/* Delete the current SRV value from the state freeing it and the value is set
* to NULL meaning empty. */
-static void
+STATIC void
state_del_current_srv(void)
{
state_query(SR_STATE_ACTION_DEL, SR_STATE_OBJ_CURSRV, NULL, NULL);
/* Delete the previous SRV value from the state freeing it and the value is
* set to NULL meaning empty. */
-static void
+STATIC void
state_del_previous_srv(void)
{
state_query(SR_STATE_ACTION_DEL, SR_STATE_OBJ_PREVSRV, NULL, NULL);
STATIC void set_sr_phase(sr_phase_t phase);
STATIC sr_state_t *get_sr_state(void);
+STATIC void state_del_previous_srv(void);
+STATIC void state_del_current_srv(void);
#endif /* TOR_UNIT_TESTS */
"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
sizeof(srv->value));
+ /* sr_state_set_previous_srv() does not free() the old previous srv. */
+ state_del_previous_srv();
sr_state_set_previous_srv(srv);
if (also_current) {
"NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN",
sizeof(srv->value));
+ /* sr_state_set_previous_srv() does not free() the old current srv. */
+ state_del_current_srv();
sr_state_set_current_srv(srv);
}
}