Skip to content

Commit

Permalink
[ril] Fix RilCellInfo object leak. JB#49798
Browse files Browse the repository at this point in the history
On some devices RIL requires to reset the modem while switching radio
capabilities. During this procedure all associated objects should be
disposed and replaced by new instances. This patch fixes a memory
leak through RilCellInfo object.
  • Loading branch information
d-grigorev committed May 5, 2020
1 parent 51bfb17 commit 53929f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ofono/drivers/ril/ril_plugin.c
Expand Up @@ -384,6 +384,7 @@ static void ril_plugin_shutdown_slot(ril_slot *slot, gboolean kill_io)
}

if (slot->cell_info) {
sailfish_manager_set_cell_info(slot->handle, NULL);
sailfish_cell_info_unref(slot->cell_info);
slot->cell_info = NULL;
}
Expand Down Expand Up @@ -1041,13 +1042,13 @@ static void ril_plugin_slot_connected(ril_slot *slot)
slot->path, slot->config.techs, slot->imei,
slot->imeisv, ril_plugin_sim_state(slot),
slot->slot_flags);
sailfish_manager_set_cell_info(slot->handle, slot->cell_info);
grilio_channel_set_enabled(slot->io, slot->handle->enabled);

/* Check if this was the last slot we were waiting for */
ril_plugin_check_if_started(plugin);
}

sailfish_manager_set_cell_info(slot->handle, slot->cell_info);
ril_plugin_check_modem(slot);
ril_plugin_check_ready(slot);
}
Expand Down

0 comments on commit 53929f9

Please sign in to comment.