diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk/hostlist_table.c | 6 | ||||
-rw-r--r-- | ui/qt/endpoint_dialog.cpp | 3 | ||||
-rw-r--r-- | ui/traffic_table_ui.c | 9 |
3 files changed, 13 insertions, 5 deletions
diff --git a/ui/gtk/hostlist_table.c b/ui/gtk/hostlist_table.c index 8db01f30ce..7913acc108 100644 --- a/ui/gtk/hostlist_table.c +++ b/ui/gtk/hostlist_table.c @@ -585,14 +585,16 @@ draw_hostlist_table_data(hostlist_table *hl) /* Filled in from the GeoIP config, if any */ for (j = 0; j < ENDP_NUM_GEOIP_COLUMNS; j++) { if (host->myaddress.type == AT_IPv4 && j < geoip_db_num_dbs()) { - const guchar *name = geoip_db_lookup_ipv4(j, pntoh32(host->myaddress.data), "-"); + guchar *name = geoip_db_lookup_ipv4(j, pntoh32(host->myaddress.data), "-"); geoip[j] = g_strdup(name); + wmem_free(NULL, name); } else if (host->myaddress.type == AT_IPv6 && j < geoip_db_num_dbs()) { - const guchar *name; + guchar *name; const struct e_in6_addr *addr = (const struct e_in6_addr *) host->myaddress.data; name = geoip_db_lookup_ipv6(j, *addr, "-"); geoip[j] = g_strdup(name); + wmem_free(NULL, name); } else { geoip[j] = NULL; } diff --git a/ui/qt/endpoint_dialog.cpp b/ui/qt/endpoint_dialog.cpp index 615298dc30..478936d60c 100644 --- a/ui/qt/endpoint_dialog.cpp +++ b/ui/qt/endpoint_dialog.cpp @@ -267,7 +267,7 @@ public: EndpointTreeWidget *ep_tree = qobject_cast<EndpointTreeWidget *>(treeWidget()); if (ep_tree) { for (int col = ENDP_NUM_COLUMNS; col < ep_tree->columnCount(); col++) { - const char *col_text = NULL; + char *col_text = NULL; foreach (unsigned db, ep_tree->columnToDb(col)) { if (endp_item->myaddress.type == AT_IPv4) { col_text = geoip_db_lookup_ipv4(db, pntoh32(endp_item->myaddress.data), NULL); @@ -280,6 +280,7 @@ public: } } setText(col, col_text ? col_text : geoip_none_); + wmem_free(NULL, col_text); } } #endif diff --git a/ui/traffic_table_ui.c b/ui/traffic_table_ui.c index 2609ca5fd8..07895aaf97 100644 --- a/ui/traffic_table_ui.c +++ b/ui/traffic_table_ui.c @@ -195,7 +195,7 @@ create_endpoint_geoip_map(const GArray *endp_array, gchar **err_str) { tpl_entry = g_string_new(""); for (i = 0; i < endp_array->len; i++) { - const char *lat, *lon, *country, *city, *asn; + char *lat = NULL, *lon = NULL, *country = NULL, *city = NULL, *asn = NULL; hostlist_talker_t *endp_item = &g_array_index(endp_array, hostlist_talker_t, i); if (endp_item->myaddress.type == AT_IPv4) { @@ -272,8 +272,13 @@ create_endpoint_geoip_map(const GArray *endp_array, gchar **err_str) { map_endpoint_opener = ",\n{\n"; } - /* XXX Display an error if we we have no entries */ + wmem_free(NULL, lat); + wmem_free(NULL, lon); + wmem_free(NULL, country); + wmem_free(NULL, city); + wmem_free(NULL, asn); + /* XXX Display an error if we we have no entries */ } while (fgets(tpl_line, MAX_TPL_LINE_LEN, tpl_file) != NULL) { |