aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/examples/postinmemory.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/docs/examples/postinmemory.c b/docs/examples/postinmemory.c
index 376f33450..e2718c5ba 100644
--- a/docs/examples/postinmemory.c
+++ b/docs/examples/postinmemory.c
@@ -104,10 +104,9 @@ int main(void)
/* always cleanup */
curl_easy_cleanup(curl);
-
- /* we're done with libcurl, so clean it up */
- curl_global_cleanup();
}
+
free(chunk.memory);
+ curl_global_cleanup();
return 0;
}