From 009d2336fe23329dc19af4bf958be412c1072f15 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Mon, 1 Jul 2013 21:42:15 +0200 Subject: lib506.c: Fixed possible use of uninitialized variables --- tests/libtest/lib506.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/libtest/lib506.c') 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" ); -- cgit v1.2.3