summaryrefslogtreecommitdiff
path: root/src/or/geoip.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-01-16 15:07:58 -0500
committerNick Mathewson <nickm@torproject.org>2012-01-16 15:07:58 -0500
commit2bd40a8eb0be195022558addb868edf56162f9dc (patch)
tree7e234f80696dd17f212afba95b75e81a632bd03e /src/or/geoip.c
parent79bb44c219af8f88573fb33954e5d2e16ef8fe42 (diff)
parent5579bc0eafc7ef426922e23340a5f885f8e8d4e9 (diff)
downloadtor-2bd40a8eb0be195022558addb868edf56162f9dc.tar.gz
tor-2bd40a8eb0be195022558addb868edf56162f9dc.zip
Merge branch 'bug4889_v2'
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r--src/or/geoip.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 73194ae9c6..3e1ee5987f 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -856,9 +856,7 @@ geoip_get_client_history(geoip_client_action_t action)
/* Build the result. */
chunks = smartlist_create();
SMARTLIST_FOREACH(entries, c_hist_t *, ch, {
- char *buf=NULL;
- tor_asprintf(&buf, "%s=%u", ch->country, ch->total);
- smartlist_add(chunks, buf);
+ smartlist_add_asprintf(chunks, "%s=%u", ch->country, ch->total);
});
result = smartlist_join_strings(chunks, ",", 0, NULL);
done:
@@ -907,10 +905,8 @@ geoip_get_request_history(geoip_client_action_t action)
strings = smartlist_create();
SMARTLIST_FOREACH(entries, c_hist_t *, ent, {
- char *buf = NULL;
- tor_asprintf(&buf, "%s=%u", ent->country, ent->total);
- smartlist_add(strings, buf);
- });
+ smartlist_add_asprintf(strings, "%s=%u", ent->country, ent->total);
+ });
result = smartlist_join_strings(strings, ",", 0, NULL);
SMARTLIST_FOREACH(strings, char *, cp, tor_free(cp));
SMARTLIST_FOREACH(entries, c_hist_t *, ent, tor_free(ent));