c - How to deal with memory leak from someone else's driver -


i running c program on centos 5.5 computer. program runs loop performs tests on , on until told stop external source.

by necessity using old driver pci card communicates test system. since upgrading centos 4.5 5.5 have noticed can loop through program 175 times. @ time program halts error allocating heap memory. can watch memory being used in chunks of 10 20 mb each time program loops , system runs out of memory. when exit program using cntrl-c memory freed.

i have used valgrind indicates memory leaks in old driver. company wrote driver supports windows , haven't upgraded driver in on 5 years.

without source code there way can free memory used driver each time loop through program?

thanks.

if declare access test system through driver inside loop, should put out of scope on each iteration.

something following:

char readbuf[512]; (int = 0; < countloops; i++)  {    int fd = open("/dev/com1", o_rdwr);    readbuf = read(fd, sizeof (readbuf));    close (fd); } 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -