Package: manpages-dev
Version: 3.24-1
Severity: wishlist

The manpage of getline shows an example with an extra NULL pointer check 
before it calls free. This is unneeded according to free(3)

  If ptr is NULL, no operation is performed.

Can you please remove the if to make the example easier to read and to be more 
consistent with the statements given in free(3).
-- 
Robert Wohlrab
--- getline.3.orig	2010-03-04 16:28:38.996850440 +0100
+++ getline.3	2010-03-04 16:28:57.004849599 +0100
@@ -156,8 +156,7 @@
         printf("%s", line);
     }
 
-    if (line)
-        free(line);
+    free(line);
     exit(EXIT_SUCCESS);
 }
 .fi

Reply via email to