Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/sortinfo Free the buffer allocated by getline(3).



details:   https://anonhg.NetBSD.org/src/rev/57a0a997a3da
branches:  trunk
changeset: 823640:57a0a997a3da
user:      abhinav <abhinav%NetBSD.org@localhost>
date:      Sun Apr 30 13:45:06 2017 +0000

description:
Free the buffer allocated by getline(3).

ok christos.

diffstat:

 usr.bin/sortinfo/sortinfo.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 1b66f1f45d24 -r 57a0a997a3da usr.bin/sortinfo/sortinfo.c
--- a/usr.bin/sortinfo/sortinfo.c       Sun Apr 30 12:32:40 2017 +0000
+++ b/usr.bin/sortinfo/sortinfo.c       Sun Apr 30 13:45:06 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sortinfo.c,v 1.5 2015/12/21 16:17:09 christos Exp $    */
+/*     $NetBSD: sortinfo.c,v 1.6 2017/04/30 13:45:06 abhinav Exp $     */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: sortinfo.c,v 1.5 2015/12/21 16:17:09 christos Exp $");
+__RCSID("$NetBSD: sortinfo.c,v 1.6 2017/04/30 13:45:06 abhinav Exp $");
 
 /*
  * Sort a texinfo(1) directory file.
@@ -153,6 +153,7 @@
                        continue;
                }
 
+       free(line);
        qsort(slist, nsections, sizeof(*slist), compsection);
        for (i = 0; i < nsections; i++) {
                s = &slist[i];



Home | Main Index | Thread Index | Old Index