summaryrefslogtreecommitdiff
path: root/src/test/test_dir.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-06-30 14:30:28 -0400
committerNick Mathewson <nickm@torproject.org>2016-06-30 14:30:28 -0400
commit9a92f582191e76039b639ef29167a05563623d0c (patch)
treec4da585da56dff809368909a070a226cabb2162a /src/test/test_dir.c
parent7a7bd1f9ea2df2fc68d0ce4b59ebd413ba7f0ba6 (diff)
downloadtor-9a92f582191e76039b639ef29167a05563623d0c.tar.gz
tor-9a92f582191e76039b639ef29167a05563623d0c.zip
Avoid naked strdups in test_dir.c
Diffstat (limited to 'src/test/test_dir.c')
-rw-r--r--src/test/test_dir.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 8c708f0eb7..576b4e45d6 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -4148,9 +4148,9 @@ mock_get_datadir_fname(const or_options_t *options,
/* Just duplicate the basename and return it for this mock */
if (sub2) {
/* If we have sub2, it's the basename, otherwise sub1 */
- rv = strdup(sub2);
+ rv = tor_strdup(sub2);
} else {
- rv = strdup(sub1);
+ rv = tor_strdup(sub1);
}
done:
@@ -5024,13 +5024,13 @@ pop_one_mock(const char *dirname, const char *f)
if (dirname != NULL && strcmp(dirname, "d") == 0) {
if (f != NULL && strcmp(f, "foo") == 0) {
ent = tor_malloc_zero(sizeof(*ent));
- ent->filename = strdup("d/foo");
+ ent->filename = tor_strdup("d/foo");
ent->len = 123;
ent->digest_sha256[0] = 1;
ent->when = 1024;
} else if (f != NULL && strcmp(f, "bar") == 0) {
ent = tor_malloc_zero(sizeof(*ent));
- ent->filename = strdup("d/bar");
+ ent->filename = tor_strdup("d/bar");
ent->len = 456;
ent->digest_sha256[0] = 2;
/*
@@ -5040,7 +5040,7 @@ pop_one_mock(const char *dirname, const char *f)
ent->when = 512;
} else if (f != NULL && strcmp(f, "baz") == 0) {
ent = tor_malloc_zero(sizeof(*ent));
- ent->filename = strdup("d/baz");
+ ent->filename = tor_strdup("d/baz");
ent->len = 789;
ent->digest_sha256[0] = 3;
ent->when = 768;