[PATCH] getline.3: fix memory leak in example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



close opened file at the end

Signed-off-by: Rahul Bedarkar <rahulbedarkar89@xxxxxxxxx>
---
 man3/getline.3 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/man3/getline.3 b/man3/getline.3
index c0b77d3..4b9c452 100644
--- a/man3/getline.3
+++ b/man3/getline.3
@@ -167,6 +167,7 @@ main(void)
     }
 
     free(line);
+    fclose(fp);
     exit(EXIT_SUCCESS);
 }
 .fi
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux