mirror of git://git.sysmocom.de/ofono
gisi: fix crash bug in g_isi_remove_subscription
This commit is contained in:
parent
2ab42201db
commit
39823fee14
|
@ -744,16 +744,19 @@ int g_isi_subscribe(GIsiClient *client, uint8_t type,
|
||||||
*/
|
*/
|
||||||
void g_isi_remove_subscription(GIsiClient *client, uint8_t res, uint8_t type)
|
void g_isi_remove_subscription(GIsiClient *client, uint8_t res, uint8_t type)
|
||||||
{
|
{
|
||||||
|
void *ret;
|
||||||
GIsiIndication *ind;
|
GIsiIndication *ind;
|
||||||
unsigned int id = (res << 8) | type;
|
unsigned int id = (res << 8) | type;
|
||||||
|
|
||||||
if (!client)
|
if (!client)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ind = tdelete(&id, &client->inds.subs, g_isi_cmp);
|
ret = tfind(&id, &client->inds.subs, g_isi_cmp);
|
||||||
if (!ind)
|
if (!ret)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ind = *(GIsiIndication **)ret;
|
||||||
|
tdelete(ind, &client->inds.subs, g_isi_cmp);
|
||||||
client->inds.count--;
|
client->inds.count--;
|
||||||
g_free(ind);
|
g_free(ind);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue