Skip to contentSkip to conversation

core.5: fix memory leak in example

PATCH In review Rahul Bedarkar 2 participants 2 messages Aug 2, 2014 – Aug 15, 2014 1 message not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 core.5: fix memory leak in example

close opened file at the end

---
 man5/core.5 | 1 +
 1 file changed, 1 insertion(+)
man5/core.5 +1 -0
index 074add6..f2c3e36 100644
@@ -422,6 +422,7 @@ main(int argc, char *argv[])
         tot += nread;
     fprintf(fp, "Total bytes in core dump: %d\\n", tot);
 
+    fclose(fp);
     exit(EXIT_SUCCESS);
 }
 .fi
Signature · 6 lines
1.8.3.2

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

A message that is not in the archive (sent off-list or not yet received): 1406973777-3078-1-git-send-email-rahulbedarkar89-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 1 line · Rahul Bedarkar

close opened file at the end

Thanks, Rahul. Applied.

Cheers,

Michael

Quoted 18 lines
---
 man5/core.5 | 1 +
 1 file changed, 1 insertion(+)
man5/core.5 +1 -0
index 074add6..f2c3e36 100644
@@ -422,6 +422,7 @@ main(int argc, char *argv[])
         tot += nread;
     fprintf(fp, "Total bytes in core dump: %d\\n", tot);
 
+    fclose(fp);
     exit(EXIT_SUCCESS);
 }
 .fi
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html