summaryrefslogtreecommitdiff
path: root/docs/examples/postinmemory.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-02-14 11:53:02 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-02-14 23:30:43 +0100
commit52d98194b539605a4bd5bfeddc367bff283ac28f (patch)
treef84c0af447b8aa94cc62fbf8f3bd86a54b2bf799 /docs/examples/postinmemory.c
parent9bd704c02a583e01db96ce3aec77f058e817665c (diff)
downloadcurl-52d98194b539605a4bd5bfeddc367bff283ac28f.tar.gz
examples/postinmemory: Potential leak of memory pointed to by 'chunk.memory'
Detected by scan-build
Diffstat (limited to 'docs/examples/postinmemory.c')
-rw-r--r--docs/examples/postinmemory.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/docs/examples/postinmemory.c b/docs/examples/postinmemory.c
index 25a1e8eae..376f33450 100644
--- a/docs/examples/postinmemory.c
+++ b/docs/examples/postinmemory.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -67,7 +67,6 @@ int main(void)
curl_global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
if(curl) {
-
curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.org/");
/* send all data to this function */
@@ -106,10 +105,9 @@ int main(void)
/* always cleanup */
curl_easy_cleanup(curl);
- free(chunk.memory);
-
/* we're done with libcurl, so clean it up */
curl_global_cleanup();
}
+ free(chunk.memory);
return 0;
}