Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Evangelos Ribeiro Tzaras
chatty
Commits
bc2010b7
Commit
bc2010b7
authored
Jul 05, 2021
by
Mohammed Sadiq
Browse files
matrix-api: Fix various memory leaks
parent
d7c04b0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/matrix/matrix-api.c
View file @
bc2010b7
...
...
@@ -860,6 +860,7 @@ matrix_api_finalize (GObject *object)
g_cancellable_cancel
(
self
->
cancellable
);
g_clear_object
(
&
self
->
cancellable
);
g_clear_object
(
&
self
->
matrix_enc
);
g_clear_object
(
&
self
->
matrix_net
);
g_clear_handle_id
(
&
self
->
resync_id
,
g_source_remove
);
...
...
@@ -870,6 +871,9 @@ matrix_api_finalize (GObject *object)
matrix_utils_free_buffer
(
self
->
password
);
matrix_utils_free_buffer
(
self
->
access_token
);
g_free
(
self
->
next_batch
);
g_clear_error
(
&
self
->
error
);
G_OBJECT_CLASS
(
matrix_api_parent_class
)
->
finalize
(
object
);
}
...
...
@@ -1302,8 +1306,9 @@ matrix_api_get_members_async (MatrixApi *self,
task
=
g_task_new
(
self
,
self
->
cancellable
,
callback
,
user_data
);
query
=
g_hash_table_new_full
(
g_str_hash
,
g_str_equal
,
NULL
,
NULL
);
g_hash_table_insert
(
query
,
"membership"
,
"join"
);
query
=
g_hash_table_new_full
(
g_str_hash
,
g_str_equal
,
g_free
,
(
GDestroyNotify
)
matrix_utils_free_buffer
);
g_hash_table_insert
(
query
,
g_strdup
(
"membership"
),
g_strdup
(
"join"
));
if
(
self
->
next_batch
)
g_hash_table_insert
(
query
,
g_strdup
(
"since"
),
g_strdup
(
self
->
next_batch
));
...
...
@@ -1346,7 +1351,8 @@ matrix_api_load_prev_batch_async (MatrixApi *self,
task
=
g_task_new
(
self
,
self
->
cancellable
,
callback
,
user_data
);
/* Create a query to get past 30 messages */
query
=
g_hash_table_new_full
(
g_str_hash
,
g_str_equal
,
NULL
,
NULL
);
query
=
g_hash_table_new_full
(
g_str_hash
,
g_str_equal
,
free
,
(
GDestroyNotify
)
matrix_utils_free_buffer
);
g_hash_table_insert
(
query
,
g_strdup
(
"from"
),
g_strdup
(
prev_batch
));
g_hash_table_insert
(
query
,
g_strdup
(
"dir"
),
g_strdup
(
"b"
));
g_hash_table_insert
(
query
,
g_strdup
(
"limit"
),
g_strdup
(
"30"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment