aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2013-07-01 21:42:15 +0200
committerMarc Hoersken <info@marc-hoersken.de>2013-07-01 21:42:15 +0200
commit009d2336fe23329dc19af4bf958be412c1072f15 (patch)
tree3f8948943986e33b2425fe4d4abd9540361797a6 /tests/libtest
parentabca89aaa0fb208cfaf4ead6692014c4e553388a (diff)
lib506.c: Fixed possible use of uninitialized variables
Diffstat (limited to 'tests/libtest')
-rw-r--r--tests/libtest/lib506.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c
index bddda128c..4d2864de9 100644
--- a/tests/libtest/lib506.c
+++ b/tests/libtest/lib506.c
@@ -149,11 +149,11 @@ int test(char *URL)
{
int res;
CURLSHcode scode = CURLSHE_OK;
- char *url;
+ char *url = NULL;
struct Tdata tdata;
CURL *curl;
CURLSH *share;
- struct curl_slist *headers;
+ struct curl_slist *headers = NULL;
int i;
struct userdata user;
@@ -286,9 +286,12 @@ test_cleanup:
/* clean up last handle */
printf( "CLEANUP\n" );
curl_easy_cleanup( curl );
- curl_slist_free_all( headers );
- curl_free(url);
+ if ( headers )
+ curl_slist_free_all( headers );
+
+ if ( url )
+ curl_free(url);
/* free share */
printf( "SHARE_CLEANUP\n" );