summaryrefslogtreecommitdiff
path: root/src/test/test_util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-03-21 07:53:46 -0400
committerNick Mathewson <nickm@torproject.org>2013-03-21 07:53:46 -0400
commit294c89f238df2c7feb1f2fba0bf3a3ad824acfee (patch)
tree490d698365d590208ec74c7f1a7a632fdc2ee3af /src/test/test_util.c
parente9ffd9890f6073bc2fc3be36be2fd521a4f3af96 (diff)
parent42fb61d172b172687cd57c86dd72b117f03f2136 (diff)
downloadtor-294c89f238df2c7feb1f2fba0bf3a3ad824acfee.tar.gz
tor-294c89f238df2c7feb1f2fba0bf3a3ad824acfee.zip
Merge remote-tracking branch 'origin/maint-0.2.4'
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r--src/test/test_util.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 8939356779..0679275fc6 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -860,7 +860,7 @@ test_util_strmisc(void)
{
char buf[1024];
int i;
- char *cp;
+ char *cp, *cp_tmp;
/* Test strl operations */
test_eq(5, strlcpy(buf, "Hello", 0));
@@ -1063,20 +1063,20 @@ test_util_strmisc(void)
/* Test strndup and memdup */
{
const char *s = "abcdefghijklmnopqrstuvwxyz";
- cp = tor_strndup(s, 30);
- test_streq(cp, s); /* same string, */
- test_neq_ptr(cp, s); /* but different pointers. */
- tor_free(cp);
+ cp_tmp = tor_strndup(s, 30);
+ test_streq(cp_tmp, s); /* same string, */
+ test_neq_ptr(cp_tmp, s); /* but different pointers. */
+ tor_free(cp_tmp);
- cp = tor_strndup(s, 5);
- test_streq(cp, "abcde");
- tor_free(cp);
+ cp_tmp = tor_strndup(s, 5);
+ test_streq(cp_tmp, "abcde");
+ tor_free(cp_tmp);
s = "a\0b\0c\0d\0e\0";
- cp = tor_memdup(s,10);
- test_memeq(cp, s, 10); /* same ram, */
- test_neq_ptr(cp, s); /* but different pointers. */
- tor_free(cp);
+ cp_tmp = tor_memdup(s,10);
+ test_memeq(cp_tmp, s, 10); /* same ram, */
+ test_neq_ptr(cp_tmp, s); /* but different pointers. */
+ tor_free(cp_tmp);
}
/* Test str-foo functions */
@@ -1155,7 +1155,7 @@ test_util_strmisc(void)
tt_int_op(strcmp_len("blah", "", 0), ==, 0);
done:
- ;
+ tor_free(cp_tmp);
}
static void