qmimodem: Fix potential memory leak

In case strlen(ICCID) > 20, we simply return without freeing the ICCID
value first.
This commit is contained in:
Denis Kenzior 2019-04-29 14:20:25 -05:00
parent 4a93c329b9
commit fbd9974998
1 changed files with 1 additions and 1 deletions

View File

@ -83,13 +83,13 @@ static void get_iccid_cb(struct qmi_result *result, void *user_data)
len = strlen(str);
if (len > 20) {
qmi_free(str);
CALLBACK_WITH_FAILURE(cb, NULL, 0, cbd->data);
return;
}
sim_encode_bcd_number(str, iccid);
iccid_len = len / 2;
qmi_free(str);
CALLBACK_WITH_SUCCESS(cb, iccid, iccid_len, cbd->data);