mirror of git://git.sysmocom.de/ofono
qmi: Fix memory leak
==14399== 28 bytes in 4 blocks are definitely lost in loss record 151 of 390 ==14399== at 0x4C2BBAF: malloc (vg_replace_malloc.c:299) ==14399== by 0x209065: convert_gsm_to_utf8_with_lang (util.c:651) ==14399== by 0x2091D1: convert_gsm_to_utf8 (util.c:690) ==14399== by 0x22DDA7: ussd_decode (smsutil.c:4738) ==14399== by 0x18BF71: qmi_ussd_request (ussd.c:233) ==14399== by 0x2183EA: ussd_initiate (ussd.c:614) ==14399== by 0x27B6C8: process_message (object.c:259) ==14399== by 0x27D1CD: generic_message (object.c:1070) ==14399== by 0x5170732: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14) ==14399== by 0x5161D83: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14) ==14399== by 0x27907C: message_dispatch (mainloop.c:72) ==14399== by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
This commit is contained in:
parent
452a6e5421
commit
ad86c7e529
|
@ -251,6 +251,7 @@ static void qmi_ussd_request(struct ofono_ussd *ussd, int dcs,
|
||||||
qmi_ussd->dcs = QMI_USSD_DCS_ASCII;
|
qmi_ussd->dcs = QMI_USSD_DCS_ASCII;
|
||||||
qmi_ussd->length = len;
|
qmi_ussd->length = len;
|
||||||
memcpy(qmi_ussd->data, utf8, utf8_len);
|
memcpy(qmi_ussd->data, utf8, utf8_len);
|
||||||
|
g_free(utf8);
|
||||||
|
|
||||||
param = qmi_param_new();
|
param = qmi_param_new();
|
||||||
if (param == NULL)
|
if (param == NULL)
|
||||||
|
@ -265,7 +266,6 @@ static void qmi_ussd_request(struct ofono_ussd *ussd, int dcs,
|
||||||
|
|
||||||
qmi_param_free(param);
|
qmi_param_free(param);
|
||||||
error:
|
error:
|
||||||
g_free(utf8);
|
|
||||||
g_free(cbd);
|
g_free(cbd);
|
||||||
CALLBACK_WITH_FAILURE(cb, data);
|
CALLBACK_WITH_FAILURE(cb, data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue