Bug 58706 - RESOURCE_LEAK type of bug in the p11_kit_pin_file_callback() function of pin.c file
Summary: RESOURCE_LEAK type of bug in the p11_kit_pin_file_callback() function of pin....
Status: RESOLVED FIXED
Alias: None
Product: p11-glue
Classification: Unclassified
Component: p11-kit (show other bugs)
Version: unspecified
Hardware: Other BSD (Others)
: medium normal
Assignee: Stef Walter
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-24 09:13 UTC by Pankaj Sharma
Modified: 2013-01-09 12:34 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
respective patch has been attached (516 bytes, patch)
2012-12-24 09:13 UTC, Pankaj Sharma
Details | Splinter Review

Description Pankaj Sharma 2012-12-24 09:13:03 UTC
Created attachment 72062 [details] [review]
respective patch has been attached

"fd" has been intialised by "open (pin_source, O_RDONLY);" ,thats why it should be closed .
 
So "close(fd)" statement should before returning the function
Comment 1 Stef Walter 2013-01-09 12:30:58 UTC
Comment on attachment 72062 [details] [review]
respective patch has been attached

Review of attachment 72062 [details] [review]:
-----------------------------------------------------------------

Thanks for catching this problem.

::: p11-kit/pin.c
@@ +466,5 @@
>  	fd = open (pin_source, O_RDONLY);
> +	if (fd == -1){
> +                close(fd);
> +           	return NULL;
> +        }

We shouldn't be running close(-1) here.
Comment 2 Stef Walter 2013-01-09 12:34:13 UTC
Applied the patch with the change noted above.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.