network: Fix temp pointer memory leak
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 8 Jul 2011 16:19:49 +0000 (18:19 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 8 Jul 2011 16:19:49 +0000 (18:19 +0200)
src/network.c

index 784f67c..4a9e863 100644 (file)
@@ -366,7 +366,7 @@ struct connman_network *connman_network_create(const char *identifier,
                                                enum connman_network_type type)
 {
        struct connman_network *network;
-       char *temp;
+       char *ident;
 
        DBG("identifier %s type %d", identifier, type);
 
@@ -379,18 +379,18 @@ struct connman_network *connman_network_create(const char *identifier,
        network->refcount = 1;
 
        if (identifier == NULL) {
-               temp = g_strdup_printf("hidden_%d", hidden_counter++);
+               ident = g_strdup_printf("hidden_%d", hidden_counter++);
                network->hidden = TRUE;
        } else
-               temp = g_strdup(identifier);
+               ident = g_strdup(identifier);
 
-       if (temp == NULL) {
+       if (ident == NULL) {
                g_free(network);
                return NULL;
        }
 
        network->type       = type;
-       network->identifier = g_strdup(temp);
+       network->identifier = ident;
 
        return network;
 }