Fixed bug #27078: Possible memory leak in pppInit()

This commit is contained in:
goldsimon 2009-08-23 17:40:29 +00:00
parent 8bf57c0e14
commit e7d5739ce7
2 changed files with 10 additions and 3 deletions

View File

@ -25,6 +25,9 @@ HISTORY
++ Bugfixes:
2009-08-23 Simon Goldschmidt
* ppp.c: bug #27078: Possible memory leak in pppInit()
2009-08-23 Simon Goldschmidt
* netdb.c, dns.c: bug #26657: DNS, if host name is "localhost", result
is error.

View File

@ -395,13 +395,17 @@ pppInit(void)
magicInit();
subnetMask = htonl(0xffffff00);
for (i = 0; i < NUM_PPP; i++) {
pppControl[i].openFlag = 0;
subnetMask = htonl(0xffffff00);
outpacket_buf[i] = (u_char *)mem_malloc(PPP_MRU+PPP_HDRLEN);
if(!outpacket_buf[i]) {
if (!outpacket_buf[i]) {
for (j = 0; j < i; j++) {
/* deallocate all preceding buffers */
mem_free(outpacket_buf[j]);
}
return ERR_MEM;
}