From 8e90c3368c31f50c4ddaef40f1a36084685f4979 Mon Sep 17 00:00:00 2001 From: Aki Niemi Date: Wed, 2 Feb 2011 09:49:17 +0200 Subject: simutil: Add checks for NULL --- src/simutil.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/simutil.c') 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); -- cgit v1.2.3