diff options
author | Aki Niemi <aki.niemi@nokia.com> | 2011-02-02 09:49:17 +0200 |
---|---|---|
committer | Aki Niemi <aki.niemi@nokia.com> | 2011-02-02 11:03:21 +0200 |
commit | 8e90c3368c31f50c4ddaef40f1a36084685f4979 (patch) | |
tree | 18a1e78e59ce9526257e28092190d92e1f2183a2 /src/simutil.c | |
parent | cfa179fe6b5cdb1571a4221b876acbcdeceb2a25 (diff) | |
download | ofono-8e90c3368c31f50c4ddaef40f1a36084685f4979.tar.bz2 |
simutil: Add checks for NULL
Diffstat (limited to 'src/simutil.c')
-rw-r--r-- | src/simutil.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/simutil.c b/src/simutil.c index ac9dd2f8..9298886d 100644 --- a/src/simutil.c +++ b/src/simutil.c @@ -975,6 +975,9 @@ gboolean sim_spdi_lookup(struct sim_spdi *spdi, void sim_spdi_free(struct sim_spdi *spdi) { + if (spdi == NULL) + return; + g_slist_foreach(spdi->operators, (GFunc)g_free, NULL); g_slist_free(spdi->operators); g_free(spdi); @@ -982,6 +985,9 @@ void sim_spdi_free(struct sim_spdi *spdi) static void pnn_operator_free(struct sim_eons_operator_info *oper) { + if (oper == NULL) + return; + g_free(oper->info); g_free(oper->shortname); g_free(oper->longname); @@ -1072,6 +1078,9 @@ void sim_eons_free(struct sim_eons *eons) { int i; + if (eons == NULL) + return; + for (i = 0; i < eons->pnn_max; i++) pnn_operator_free(eons->pnn_list + i); |