diff options
author | Roger Dingledine <arma@torproject.org> | 2003-10-04 03:29:09 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-10-04 03:29:09 +0000 |
commit | be874358a4385d8d6bd7f82d3f372bb79055033c (patch) | |
tree | 72b615a6357820b49e9a66ab32c3554463a7834c /src/or/dirserv.c | |
parent | f563bbd2f988cd1f6ca292f89a47a86f98fe0e8d (diff) | |
download | tor-be874358a4385d8d6bd7f82d3f372bb79055033c.tar.gz tor-be874358a4385d8d6bd7f82d3f372bb79055033c.zip |
wrap strdup; prefer time() to gettimeofday()
svn:r538
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index afe91a1616..9090f6f626 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -29,12 +29,12 @@ add_fingerprint_to_dir(const char *nickname, const char *fp) for (i = 0; i < n_fingerprints; ++i) { if (!strcasecmp(fingerprint_list[i].nickname,nickname)) { free(fingerprint_list[i].fingerprint); - fingerprint_list[i].fingerprint = strdup(fp); + fingerprint_list[i].fingerprint = tor_strdup(fp); return; } } - fingerprint_list[n_fingerprints].nickname = strdup(nickname); - fingerprint_list[n_fingerprints].fingerprint = strdup(fp); + fingerprint_list[n_fingerprints].nickname = tor_strdup(nickname); + fingerprint_list[n_fingerprints].fingerprint = tor_strdup(fp); ++n_fingerprints; } @@ -83,8 +83,8 @@ dirserv_parse_fingerprint_file(const char *fname) } } if(i == n_fingerprints_tmp) { /* not a duplicate */ - fingerprint_list_tmp[n_fingerprints_tmp].nickname = strdup(nickname); - fingerprint_list_tmp[n_fingerprints_tmp].fingerprint = strdup(fingerprint); + fingerprint_list_tmp[n_fingerprints_tmp].nickname = tor_strdup(nickname); + fingerprint_list_tmp[n_fingerprints_tmp].fingerprint = tor_strdup(fingerprint); ++n_fingerprints_tmp; } } @@ -427,7 +427,7 @@ size_t dirserv_get_directory(const char **directory) /* Now read the directory we just made in order to update our own * router lists. This does more signature checking than is strictly * necessary, but safe is better than sorry. */ - new_directory = strdup(the_directory); + new_directory = tor_strdup(the_directory); /* use a new copy of the dir, since get_dir_from_string scribbles on it */ if (router_get_dir_from_string(new_directory, get_identity_key())) { log_fn(LOG_ERR, "We just generated a directory we can't parse. Dying."); |