RE: [PATCH 1/2] imsm: delete subarray functionality

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

 



>-----Original Message-----
>From: Doug Ledford [mailto:dledford@xxxxxxxxxx]
>Sent: Thursday, April 01, 2010 6:32 PM
>To: Hawrylewicz Czarnowski, Przemyslaw; Neil Brown; linux-
>raid@xxxxxxxxxxxxxxx; Williams, Dan J; Ciechanowski, Ed
>Subject: Re: [PATCH 1/2] imsm: delete subarray functionality
>
>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.
For both mdmon_running and mdmon_pid there is a memory leak with strdup.
Did I miss something?

>
>--
>Doug Ledford <dledford@xxxxxxxxxx>
>              GPG KeyID: CFBFF194
>	      http://people.redhat.com/dledford
>
>Infiniband specific RPMs available at
>	      http://people.redhat.com/dledford/Infiniband


--
Best Regards,
Przemyslaw Hawrylewicz-Czarnowski
Software Development Engineer
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux