NetBSD-Bugs archive

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

Re: bin/47316: Memory leak in envstat with config file.



The following reply was made to PR bin/47316; it has been noted by GNATS.

From: Marc Balmer <marc%msys.ch@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/47316: Memory leak in envstat with config file.
Date: Thu, 13 Dec 2012 13:40:25 +0100

 Am 13.12.2012 um 13:20 schrieb henning.petersen%t-online.de@localhost:
 
 >> Number:         47316
 >> Category:       bin
 >> Synopsis:       Memory leak in envstat with config file.
 >> Confidential:   no
 >> Severity:       non-critical
 >> Priority:       medium
 >> Responsible:    bin-bug-people
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Thu Dec 13 12:20:01 +0000 2012
 >> Originator:     Henning Petersen
 >> Release:        NetBSD-current
 >> Organization:
 >> Environment:
 >> Description:
 > Memory leak if config file is used.
 >> How-To-Repeat:
 >=20
 >> Fix:
 > diff -u -p -r1.91 envstat.c
 > --- usr.sbin/envstat/envstat.c       11 May 2012 18:41:12 -0000      =
 1.91
 > +++ usr.sbin/envstat/envstat.c       6 Dec 2012 10:58:57 -0000
 > @@ -264,6 +264,7 @@ int main(int argc, char **argv)
 >=20
 >              rval =3D send_dictionary(cf);
 >              (void)fclose(cf);
 > +            free(configfile);
 >=20
 >      /* Show sensors with interval */
 >      } else if (interval) {
 >=20
 
 
 A free() is not needed here (in fact even more free's can be removed) =
 because the program will exit just after that.  No need to clean up the =
 dishes when the ship is sinking...
 


Home | Main Index | Thread Index | Old Index