On 04/01/2010 02:09 AM, Luca Berra wrote: > On Wed, Mar 31, 2010 at 09:50:40PM +0100, Hawrylewicz Czarnowski, > Przemyslaw wrote: >> int mdmon_pid(int devnum) >> @@ -1502,7 +1523,11 @@ int mdmon_pid(int devnum) >> char pid[10]; >> int fd; >> int n; >> - sprintf(path, "%s/%s.pid", pid_dir, devnum2devname(devnum)); >> + char *devname = devnum2devname(devnum); >> + >> + sprintf(path, "%s/%s.pid", pid_dir, devname); >> + free(devname); >> + >> fd = open(path, O_RDONLY | O_NOATIME, 0); >> >> if (fd < 0) > why? Looks like it leaks memory in the old implementation. -- Doug Ledford <dledford@xxxxxxxxxx> GPG KeyID: CFBFF194 http://people.redhat.com/dledford Infiniband specific RPMs available at http://people.redhat.com/dledford/Infiniband
Attachment:
signature.asc
Description: OpenPGP digital signature