bug-cpio
[Top][All Lists]
Advanced

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

[Bug-cpio] found resource leaks


From: Martin Ettl
Subject: [Bug-cpio] found resource leaks
Date: Sun, 21 Jun 2009 01:46:42 +0200

Hi all,

i have checked the sources of the cpio-2.10  library with the static code 
analysis tool cppcheck. It found little issues:

[cpio-2.10/src/copyin.c:1583]: (error) Resource leak: tty_in
[cpio-2.10/src/copyin.c:1583]: (error) Resource leak: tty_out
[cpio-2.10/src/copyin.c:1583]: (error) Resource leak: rename_in



Take a loop at file copyin.c at line 1583:
....
}

The function ends without flcose the opened file pointers. A possible fix might 
be :

...
 if(tty_in!=NULL) fclose(tty_in);
 if(tty_out!=NULL) fclose(tty_out);
 if(rename_in!=NULL) fclose(rename_in);
...

Best regards

Ettl Martin







-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01




reply via email to

[Prev in Thread] Current Thread [Next in Thread]