ibsysstat.c: fix resource leak
PATCH 4/6 ibsysstat.c: fix resource leak
From: Dan Ben Yosef <[email protected]>
Memory leak.
Signed-off-by Dan Ben Yosef <[email protected]>
--- src/ibsysstat.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
src/ibsysstat.c +3 -1
@@ -271,8 +271,10 @@ int build_cpuinfo(void)while (fgets (line,sizeof (line) -1 , f)) {if (!strncmp (line,"processor\t" ,10 )) { ncpu++; -if (ncpu >MAX_CPUS ) +if (ncpu >MAX_CPUS ) { +fclose (f);return MAX_CPUS ; + }continue ; }
Signature · 6 lines
1.7.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 51B87DDF.1090205-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Ira Weiny
AppliedQuoted 1 line · On Wed, 12 Jun 2013 09:55:43 -0400 Hal Rosenstock…
From: Dan Ben Yosef <[email protected]>
Thanks applied!
Ira
Quoted 28 lines
Memory leak.
Signed-off-by Dan Ben Yosef <[email protected]>--- src/ibsysstat.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)src/ibsysstat.c +3
-1@@ -271,8 +271,10 @@ int build_cpuinfo(void)while (fgets (line,sizeof (line) -1 , f)) {if (!strncmp (line,"processor\t" ,10 )) { ncpu++; -if (ncpu >MAX_CPUS ) +if (ncpu >MAX_CPUS ) { +fclose (f);return MAX_CPUS ; + }continue ; }Signature · 1 line
1.7.8.2
Signature · 5 lines
Ira Weiny <[email protected]> -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html