]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
manual: Add missing free to open_memstream example [BZ #27866]
authorRavina Jain <rajulravina123@gmail.com>
Tue, 24 Jun 2025 15:06:25 +0000 (20:36 +0530)
committerArjun Shankar <arjun@redhat.com>
Wed, 25 Jun 2025 12:26:32 +0000 (14:26 +0200)
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
manual/examples/memstrm.c

index 9ee6298a359b39ce3779ce85b06775fe593963a8..28be892aeb6b44f1858d552ec66c1f271c6f3424 100644 (file)
@@ -16,6 +16,7 @@
 */
 
 #include <stdio.h>
+#include <stdlib.h>
 
 int
 main (void)
@@ -31,6 +32,7 @@ main (void)
   fprintf (stream, ", world");
   fclose (stream);
   printf ("buf = `%s', size = %zu\n", bp, size);
+  free (bp);
 
   return 0;
 }