mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-06 05:17:57 +00:00
entropy: close fp1 on fp2 open failure
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@801 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
afcae6eba5
commit
90f79edbea
@ -1767,10 +1767,15 @@ void update_entropy (void)
|
|||||||
info.entropy.entropy_avail=0;
|
info.entropy.entropy_avail=0;
|
||||||
info.entropy.poolsize=0;
|
info.entropy.poolsize=0;
|
||||||
|
|
||||||
if ( ((fp1 = open_file (entropy_avail, &rep))==NULL) ||
|
if ((fp1 = open_file (entropy_avail, &rep))==NULL)
|
||||||
((fp2 = open_file (entropy_poolsize, &rep))==NULL) )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ((fp2 = open_file (entropy_poolsize, &rep))==NULL)
|
||||||
|
{
|
||||||
|
fclose (fp1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
fscanf (fp1, "%u", &info.entropy.entropy_avail);
|
fscanf (fp1, "%u", &info.entropy.entropy_avail);
|
||||||
fscanf (fp2, "%u", &info.entropy.poolsize);
|
fscanf (fp2, "%u", &info.entropy.poolsize);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user