Fix Web Sessions test response ownership
This commit is contained in:
parent
823184d99e
commit
4b76848c54
2 changed files with 9 additions and 0 deletions
|
|
@ -24,6 +24,12 @@ typedef struct TrainlogWebSessionsPageQuery {
|
||||||
const char *search;
|
const char *search;
|
||||||
} TrainlogWebSessionsPageQuery;
|
} TrainlogWebSessionsPageQuery;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* CONTRACT: every successful JSON-producing function below transfers one
|
||||||
|
* heap allocation through output_json; the caller owns it and releases it
|
||||||
|
* with free(). Borrowed input strings need only remain valid for the call.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CONTRACT: database and query strings are borrowed for the call. On success,
|
* CONTRACT: database and query strings are borrowed for the call. On success,
|
||||||
* output_json is heap-owned by the caller and must be released with free().
|
* output_json is heap-owned by the caller and must be released with free().
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,9 @@ static bool creation_replay_revision_and_pagination(void) {
|
||||||
&updated_size) == TRAINLOG_STATUS_OK);
|
&updated_size) == TRAINLOG_STATUS_OK);
|
||||||
CHECK(updated_size > 0U);
|
CHECK(updated_size > 0U);
|
||||||
CHECK(scalar(database, "SELECT COUNT(*) FROM session_preparation_revisions") == 2);
|
CHECK(scalar(database, "SELECT COUNT(*) FROM session_preparation_revisions") == 2);
|
||||||
|
free(detail);
|
||||||
|
detail = NULL;
|
||||||
|
detail_size = 0U;
|
||||||
CHECK(trainlog_web_sessions_save_json(database,
|
CHECK(trainlog_web_sessions_save_json(database,
|
||||||
NULL,
|
NULL,
|
||||||
"",
|
"",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue