summaryrefslogtreecommitdiff
path: root/tests/libtest/lib1537.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libtest/lib1537.c')
-rw-r--r--tests/libtest/lib1537.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/libtest/lib1537.c b/tests/libtest/lib1537.c
index b07d64fc5..9832c3a30 100644
--- a/tests/libtest/lib1537.c
+++ b/tests/libtest/lib1537.c
@@ -43,8 +43,7 @@ int test(char *URL)
asize = (int)sizeof(a);
ptr = curl_easy_escape(NULL, (char *)a, asize);
printf("%s\n", ptr);
- if(ptr)
- curl_free(ptr);
+ curl_free(ptr);
/* deprecated API */
ptr = curl_escape((char *)a, asize);
@@ -58,8 +57,7 @@ int test(char *URL)
printf("outlen == %d\n", outlen);
printf("unescape == original? %s\n",
memcmp(raw, a, outlen) ? "no" : "YES");
- if(raw)
- curl_free(raw);
+ curl_free(raw);
/* deprecated API */
raw = curl_unescape(ptr, (int)strlen(ptr));
@@ -71,10 +69,8 @@ int test(char *URL)
printf("[old] outlen == %d\n", outlen);
printf("[old] unescape == original? %s\n",
memcmp(raw, a, outlen) ? "no" : "YES");
- if(raw)
- curl_free(raw);
- if(ptr)
- curl_free(ptr);
+ curl_free(raw);
+ curl_free(ptr);
/* weird input length */
ptr = curl_easy_escape(NULL, (char *)a, -1);
@@ -86,8 +82,7 @@ int test(char *URL)
printf("unescape -1 length: %s %d\n", ptr, outlen);
test_cleanup:
- if(ptr)
- curl_free(ptr);
+ curl_free(ptr);
curl_global_cleanup();
return (int)res;