http://bugzilla.novell.com/show_bug.cgi?id=544339 Summary: net-tools-1.60-732.1: needlessly duplicated calls to fopen Classification: openSUSE Product: openSUSE 11.2 Version: Factory Platform: All OS/Version: openSUSE 11.1 Status: NEW Severity: Normal Priority: P5 - None Component: Network AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de Found By: --- I just had a look at factory package net-tools-1.60-732.1 source code file netrom_gr.c function NETROM_rprint local variables f1 and f2. I notice the following code FILE *f1 = fopen(_PATH_PROCNET_NR_NODES, "r"); FILE *f2 = fopen(_PATH_PROCNET_NR_NEIGH, "r"); char buffer[256]; int qual, n, w; /*int ext = options & FLAG_EXT; int numeric = options & FLAG_NUM_HOST; */ f1 = fopen(_PATH_PROCNET_NR_NODES, "r"); if (!f1) perror(_PATH_PROCNET_NR_NODES); f2 = fopen(_PATH_PROCNET_NR_NEIGH, "r"); if (!f2) perror(_PATH_PROCNET_NR_NEIGH); The calls to fopen look duplicated. Suggest remove the first pair to avoid a resource leak. Suggest new code FILE *f1; FILE *f2; char buffer[256]; int qual, n, w; /*int ext = options & FLAG_EXT; int numeric = options & FLAG_NUM_HOST; */ f1 = fopen(_PATH_PROCNET_NR_NODES, "r"); if (!f1) perror(_PATH_PROCNET_NR_NODES); f2 = fopen(_PATH_PROCNET_NR_NEIGH, "r"); if (!f2) perror(_PATH_PROCNET_NR_NEIGH); -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.