---
 src/network.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/network.c b/src/network.c
index eb0f797..11f0fa2 100644
--- a/src/network.c
+++ b/src/network.c
@@ -134,16 +134,28 @@ static char **network_operator_technologies(struct 
network_operator_data *opd)
                        ntechs += 1;
        }
 
-       techs = g_new0(char *, ntechs + 1);
+       techs = g_new(char *, ntechs + 1);
        ntechs = 0;
 
        for (i = 0; i < sizeof(opd->techs) * 8; i++) {
+               const char *tech;
+               unsigned int j;
+
                if (!(opd->techs & (1 << i)))
                        continue;
 
-               techs[ntechs++] = g_strdup(registration_tech_to_string(i));
+               tech = registration_tech_to_string(i);
+
+               for (j = 0; j < ntechs; j++)
+                       if (!strcmp(techs[j], tech))
+                               break;
+
+               if (j == ntechs)
+                       techs[ntechs++] = g_strdup(tech);
        }
 
+       techs[i] = NULL;
+
        return techs;
 }
 
-- 
1.7.1

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to