From fda1e1cc71ad5f9cb52aeb6d049119a0a07e3497 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakivskyy Date: Wed, 5 Oct 2011 16:18:30 +0300 Subject: [PATCH] lookup-apn: Fix crash on no APNs found --- tools/lookup-apn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/lookup-apn.c b/tools/lookup-apn.c index 1df8be00..2fa6b5be 100644 --- a/tools/lookup-apn.c +++ b/tools/lookup-apn.c @@ -45,7 +45,11 @@ static void lookup_apn(const char *match_mcc, const char *match_mnc) apns = mbpi_lookup(match_mcc, match_mnc, TRUE, &error); if (apns == NULL) { - g_print("Lookup failed: %s\n", error->message); + if (error != NULL) { + g_printerr("Lookup failed: %s\n", error->message); + g_error_free(error); + } + return; }