diff options
author | Denis Kenzior <denkenz@gmail.com> | 2024-02-26 23:30:04 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2024-02-26 23:31:12 -0600 |
commit | 6bf0a2541d43058ca789cd09046a131a430b7cb7 (patch) | |
tree | cbb5e18c56c280812bf4480d28ea5fc437cef25b | |
parent | a46dff5b2476b0e679efdde8b5af5a80472846d1 (diff) | |
download | ofono-6bf0a2541d43058ca789cd09046a131a430b7cb7.tar.gz |
lte: Fix invalid cleanup
The intent was to have l_free apply to the settings variable, not the
const ap variable. Also, while here, fix dereferencing ap if it is
NULL.
Fixes: 69adffb51633 ("lte: Add provisioning support")
-rw-r--r-- | src/lte.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -63,8 +63,8 @@ static bool provision_default_attach_info(struct ofono_lte *lte, const char *mcc, const char *mnc, const char *spn) { - struct provision_db_entry *settings; - _auto_(l_free) const struct provision_db_entry *ap = NULL; + _auto_(l_free) struct provision_db_entry *settings = NULL; + const struct provision_db_entry *ap = NULL; size_t count; size_t i; @@ -83,7 +83,7 @@ static bool provision_default_attach_info(struct ofono_lte *lte, } } - if (!is_valid_apn(ap->apn)) + if (!ap || !is_valid_apn(ap->apn)) return false; if (ap->username && strlen(ap->username) > |