merge/upstream-full #105
@@ -281,11 +281,24 @@ omemo_on_disconnect(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
free_keyfile(&omemo_ctx.identity);
|
free_keyfile(&omemo_ctx.identity);
|
||||||
|
/* These can be NULL when omemo_on_disconnect runs before a full
|
||||||
|
* init has populated them; g_hash_table_destroy and the libsignal
|
||||||
|
* destructors are not documented to be NULL-safe. */
|
||||||
|
if (omemo_ctx.known_devices) {
|
||||||
g_hash_table_destroy(omemo_ctx.known_devices);
|
g_hash_table_destroy(omemo_ctx.known_devices);
|
||||||
|
}
|
||||||
|
if (omemo_ctx.device_list_handler) {
|
||||||
g_hash_table_destroy(omemo_ctx.device_list_handler);
|
g_hash_table_destroy(omemo_ctx.device_list_handler);
|
||||||
|
}
|
||||||
|
if (omemo_ctx.device_list) {
|
||||||
g_hash_table_destroy(omemo_ctx.device_list);
|
g_hash_table_destroy(omemo_ctx.device_list);
|
||||||
|
}
|
||||||
|
if (omemo_ctx.store) {
|
||||||
signal_protocol_store_context_destroy(omemo_ctx.store);
|
signal_protocol_store_context_destroy(omemo_ctx.store);
|
||||||
|
}
|
||||||
|
if (omemo_ctx.signal) {
|
||||||
signal_context_destroy(omemo_ctx.signal);
|
signal_context_destroy(omemo_ctx.signal);
|
||||||
|
}
|
||||||
memset(&omemo_ctx, 0, sizeof(omemo_ctx));
|
memset(&omemo_ctx, 0, sizeof(omemo_ctx));
|
||||||
|
|
||||||
wins_omemo_trust_changed(NULL);
|
wins_omemo_trust_changed(NULL);
|
||||||
|
|||||||
@@ -577,6 +577,11 @@ win_show_subwin(ProfWin* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ProfLayoutSplit* layout = (ProfLayoutSplit*)window->layout;
|
ProfLayoutSplit* layout = (ProfLayoutSplit*)window->layout;
|
||||||
|
/* Free a previous pad if win_show_subwin was called twice in a row
|
||||||
|
* without an intervening win_hide_subwin. */
|
||||||
|
if (layout->subwin) {
|
||||||
|
delwin(layout->subwin);
|
||||||
|
}
|
||||||
layout->subwin = newpad(PAD_MIN_HEIGHT, subwin_cols);
|
layout->subwin = newpad(PAD_MIN_HEIGHT, subwin_cols);
|
||||||
wbkgd(layout->subwin, theme_attrs(THEME_TEXT));
|
wbkgd(layout->subwin, theme_attrs(THEME_TEXT));
|
||||||
wresize(layout->base.win, PAD_MIN_HEIGHT, cols - subwin_cols);
|
wresize(layout->base.win, PAD_MIN_HEIGHT, cols - subwin_cols);
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ _pendingPresence_free(ProfPendingPresence* presence)
|
|||||||
g_date_time_unref(presence->last_activity);
|
g_date_time_unref(presence->last_activity);
|
||||||
free(presence->barejid);
|
free(presence->barejid);
|
||||||
resource_destroy(presence->resource);
|
resource_destroy(presence->resource);
|
||||||
|
jabber.developer marked this conversation as resolved
|
|||||||
|
presence->resource = NULL;
|
||||||
free(presence);
|
free(presence);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,6 +137,7 @@ roster_update_presence(const char* const barejid, Resource* resource, GDateTime*
|
|||||||
if (contact == NULL) {
|
if (contact == NULL) {
|
||||||
/* Don't lose resource when there is no owner. */
|
/* Don't lose resource when there is no owner. */
|
||||||
resource_destroy(resource);
|
resource_destroy(resource);
|
||||||
|
resource = NULL;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!_datetimes_equal(p_contact_last_activity(contact), last_activity)) {
|
if (!_datetimes_equal(p_contact_last_activity(contact), last_activity)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user
We also clean it on line 138. Potential for double free. We need to set it to
NULLinresource.cfor safety. At least the resource itself.Fixed in
60da899bd— caller now nulls its pointer afterresource_destroy.I am not sure where to reply, but in the
roster_update_presence,resourceis a param. setting it tonullbefore returning does not increase safety. it will just override a local variable.Corrected