NetBSD-Bugs archive

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

Re: lib/50259: Small memory leaks in localtime's code



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

From: David CARLIER <devnexen%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: lib/50259: Small memory leaks in localtime's code
Date: Sun, 20 Sep 2015 16:14:26 +0100

 --Apple-Mail=_C6DAE2EC-D408-44A9-BBBC-BAE4F82BEDFF
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 Hi here a different patch with ALL_STATE handling.
 
 Hope it helps.
 
 
 --Apple-Mail=_C6DAE2EC-D408-44A9-BBBC-BAE4F82BEDFF
 Content-Disposition: attachment;
 	filename=patch-lib_libc_time_localtime.diff
 Content-Type: application/octet-stream;
 	name="patch-lib_libc_time_localtime.diff"
 Content-Transfer-Encoding: 7bit
 
 Index: time/localtime.c
 ===================================================================
 RCS file: /cvsroot/src/lib/libc/time/localtime.c,v
 retrieving revision 1.97
 diff -r1.97 localtime.c
 169a170
 > #ifdef	ALL_STATE
 171a173,178
 > #else
 > static struct state lclmem;
 > static struct state gmtmem;
 > static timezone_t lclptr = &lclmem;
 > static timezone_t gmtptr = &gmtmem;
 > #endif
 344a352
 > #ifdef ALL_STATE
 348a357
 > #endif
 1294a1304
 > #ifdef	ALL_STATE
 1302a1313,1318
 > #else
 > 	if (zoneinit(sp, name) != 0)
 > 		zoneinit(sp, "");
 > 	if (0 < lcl)
 > 		strcpy(lcl_TZname, name);
 > #endif
 1336a1353
 > #ifdef	ALL_STATE
 1339a1357,1359
 > #else
 >                 gmtload(gmtptr);
 > #endif
 1403a1424
 > #ifdef	ALL_STATE
 1407a1429
 > #endif
 1527a1550
 > #ifdef	ALL_STATE
 1530a1554,1557
 > #else
 > 	if (result)
 > 		result->TM_ZONE = offset ? __UNCONST(wildabbr) : gmtptr->chars;
 > #endif
 1597a1625
 > #ifdef	ALL_STATE
 1598a1627,1629
 > #else
 >         i = sp->leapcnt;
 > #endif
 2028a2060
 > #ifdef	ALL_STATE
 2030a2063
 > #endif
 2133a2167
 > #ifdef	ALL_STATE
 2137a2172
 > #endif
 2280a2316
 > #ifdef	ALL_STATE
 2282a2319,2321
 > #else
 > 	t = (time_t)(t - leapcorr(lclptr, t));
 > #endif
 2322a2362
 > #ifdef	ALL_STATE
 2324a2365,2367
 > #else
 > 	t = posix2time_z(lclptr, t);
 > #endif
 
 --Apple-Mail=_C6DAE2EC-D408-44A9-BBBC-BAE4F82BEDFF
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 
 
 --Apple-Mail=_C6DAE2EC-D408-44A9-BBBC-BAE4F82BEDFF--
 



Home | Main Index | Thread Index | Old Index