fix a few memory leaks

This commit is contained in:
2019-07-08 15:15:29 +02:00
parent 623649dd86
commit 8718ef85a0
3 changed files with 6 additions and 4 deletions

View File

@@ -296,7 +296,7 @@ void dc_account_set_friends(dc_account_t a, dc_account_t *friends, size_t len)
g_ptr_array_remove_range(a->friends, 0, a->friends->len);
for (i = 0; i < len; i++) {
g_ptr_array_add(a->friends, friends[i]);
g_ptr_array_add(a->friends, dc_ref(friends[i]));
}
}

View File

@@ -53,7 +53,9 @@ bool dc_api_get_friends(dc_api_t api, dc_account_t login)
cleanup:
g_ptr_array_free(f, FALSE);
if (f != NULL) {
g_ptr_array_unref(f);
}
json_decref(reply);
reply = NULL;