cups-filters icon indicating copy to clipboard operation
cups-filters copied to clipboard

MEMORY_LEAK in ../utils/cups-browsed.c

Open ellena13 opened this issue 2 years ago • 1 comments

  • Dynamic memory, referenced by p->make_model, is allocated by calling function strdup :

https://github.com/OpenPrinting/cups-filters/blob/8ac453d0c22a87984127f4c89bd5747d1409db23/utils/cups-browsed.c#L7155-L7159

  • Dynamic memory, referenced by p->pdl, is allocated by calling function strdup :

https://github.com/OpenPrinting/cups-filters/blob/8ac453d0c22a87984127f4c89bd5747d1409db23/utils/cups-browsed.c#L7160-L7164

  • Dynamic memory, referenced by p->ip, is allocated by calling function strdup :

https://github.com/OpenPrinting/cups-filters/blob/8ac453d0c22a87984127f4c89bd5747d1409db23/utils/cups-browsed.c#L7183

and lost at cups-browsed.c:7209:

https://github.com/OpenPrinting/cups-filters/blob/8ac453d0c22a87984127f4c89bd5747d1409db23/utils/cups-browsed.c#L7207-L7210

Other dynamic memory allocations in this function are protected from MEMORY_LEAK by calling goto fail. But there are no such checks for these 3 cases.

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.

Author E. Bykhanova.

ellena13 avatar Oct 05 '23 08:10 ellena13

Please run your scanner on the latest cups-filters version - 2.0.0, thank you!

zdohnal avatar Oct 12 '23 07:10 zdohnal