[gnome-software/wip/temp/ubuntu-xenial-rebased-corrected: 198/331] apt: fix is_open_source



commit 59e530f129eb96933f7bb995bb1b96f285594459
Author: Iain Lane <iain orangesquash org uk>
Date:   Tue Apr 12 09:46:44 2016 +0100

    apt: fix is_open_source

 src/plugins/gs-plugin-apt.cc |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/gs-plugin-apt.cc b/src/plugins/gs-plugin-apt.cc
index 7ade736..7b187c6 100644
--- a/src/plugins/gs-plugin-apt.cc
+++ b/src/plugins/gs-plugin-apt.cc
@@ -417,15 +417,16 @@ is_allowed_section (PackageInfo *info)
 static gchar *
 get_origin (PackageInfo *info)
 {
-       gchar *origin_lower = g_strdup (info->origin);
+       if (!info->origin)
+               return NULL;
+
+       g_autofree gchar *origin_lower = g_strdup (info->origin);
        gchar *out;
        for (int i = 0; origin_lower[i]; ++i)
-               g_ascii_tolower(origin_lower[i]);
+               origin_lower[i] = g_ascii_tolower (origin_lower[i]);
 
        out = g_strdup_printf ("%s-%s-%s", origin_lower, info->release, info->component);
 
-       g_free (origin_lower);
-
        return out;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]