]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
somewhat nicer libcurl usage
authorDaniel Stenberg <daniel@haxx.se>
Mon, 31 Jan 2005 20:03:01 +0000 (20:03 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 31 Jan 2005 20:03:01 +0000 (20:03 +0000)
docs/examples/htmltitle.cc

index 7d0cc4c3c479fe93d5173e3d2bb1a02b87933775..9e683488f8fb6ac2a99b41208cc379f6f0df7bc2 100644 (file)
@@ -266,6 +266,8 @@ int main(int argc, char *argv[])
     exit(EXIT_FAILURE);
   }
 
+  curl_global_init(CURL_GLOBAL_DEFAULT);
+
   // Initialize CURL connection
 
   if (!init(conn, argv[1]))
@@ -278,6 +280,8 @@ int main(int argc, char *argv[])
   // Retrieve content for the URL
 
   code = curl_easy_perform(conn);
+  curl_easy_cleanup(conn);
+
   if (code != CURLE_OK)
   {
     fprintf(stderr, "Failed to get '%s' [%s]\n", argv[1], errorBuffer);