[Nut-upsdev] Small memory leak in libusb.c

Peter Selinger selinger at mathstat.dal.ca
Thu Feb 15 22:38:05 CET 2007


Thanks, I fixed it. The "if (blah == NULL)" is not actually needed,
since free() handles NULL pointers correctly. -- Peter

Schmier, Jacob wrote:
> 
> I noticed a small ( < 1k ) memory leak in libusb.c's libusb_open.  When
> retrieving the descriptor information, strdup is used to set the
> Vendor/Product/Serial strings for the current device.  The memory
> allocated by strdup is not deallocated in subsequent iterations of the
> loop.  The leak is quite small and really isn't a huge problem.  I
> believe that the attached patch should correct this.
> 
> Jacob Schmier=20
> =20
> The information contained in this E-mail may be confidential and/or =
> proprietary to Inter-Tel and/or its affiliates. The information =
> transmitted herewith is intended only for use by the individual or =
> entity to which it is addressed. If the reader of this message is not =
> the intended recipient, you are hereby notified that any review, =
> retransmission, dissemination, distribution, copying or other use of, or =
> taking of any action in reliance upon this information is strictly =
> prohibited. If you have received this communication in error, please =
> contact the sender and delete the material from your computer.



More information about the Nut-upsdev mailing list