diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2005-01-31 20:03:01 +0000 | 
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2005-01-31 20:03:01 +0000 | 
| commit | 21b410545445d8465011d4b4b91f7b5fe38b3095 (patch) | |
| tree | 391a5616d2a8e31170fbb0afb804e8c2e616512a | |
| parent | d7648d94ca802752ea6d8c061fecb87bce6d3d17 (diff) | |
somewhat nicer libcurl usage
| -rw-r--r-- | docs/examples/htmltitle.cc | 4 | 
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/examples/htmltitle.cc b/docs/examples/htmltitle.cc index 7d0cc4c3c..9e683488f 100644 --- a/docs/examples/htmltitle.cc +++ b/docs/examples/htmltitle.cc @@ -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);  | 
