public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Øyvind Harboe" <oyvind.harboe@zylin.com>
To: "eCos Disuss" <ecos-patches@ecos.sourceware.org>
Subject: Fix for memory leak in profiling
Date: Mon, 10 Mar 2008 13:45:00 -0000	[thread overview]
Message-ID: <c09652430803100645q4e143386m74258da29bcaa5ce@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 75 bytes --]

-- 
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA  developer kit

[-- Attachment #2: fixleak.txt --]
[-- Type: text/plain, Size: 1659 bytes --]

### Eclipse Workspace Patch 1.0
#P ecos
Index: services/profile/gprof/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/services/profile/gprof/current/ChangeLog,v
retrieving revision 1.9
diff -u -r1.9 ChangeLog
--- services/profile/gprof/current/ChangeLog	21 Dec 2007 16:47:15 -0000	1.9
+++ services/profile/gprof/current/ChangeLog	10 Mar 2008 13:45:01 -0000
@@ -1,3 +1,7 @@
+2008-03-10  Oyvind Harboe  <oyvind.harboe@zylin.com>
+	
+	* src/profile.c: plug memory leak.
+	
 2007-12-14  Oyvind Harboe  <oyvind.harboe@zylin.com>
 2007-12-21  Jonathan Larmour  <jifl@eCosCentric.com>
 
Index: services/profile/gprof/current/src/profile.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/services/profile/gprof/current/src/profile.c,v
retrieving revision 1.6
diff -u -r1.6 profile.c
--- services/profile/gprof/current/src/profile.c	21 Dec 2007 16:47:15 -0000	1.6
+++ services/profile/gprof/current/src/profile.c	10 Mar 2008 13:45:01 -0000
@@ -577,10 +577,15 @@
 
     profile_enabled = 1;
 
-#ifdef CYGPKG_PROFILE_TFTP    
-    // Create a TFTP server to provide the data
-    // invoking this a second time is harmless
-    (void) tftpd_start(CYGNUM_PROFILE_TFTP_PORT, &profile_tftp_fileops);
+#ifdef CYGPKG_PROFILE_TFTP
+    static int launched = 0;
+    if (!launched)
+    {
+    	launched = 1;
+	    // Create a TFTP server to provide the data
+	    // invoking this a second time is harmless
+	    (void) tftpd_start(CYGNUM_PROFILE_TFTP_PORT, &profile_tftp_fileops);
+    }
 #endif    
 }
 

             reply	other threads:[~2008-03-10 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-10 13:45 Øyvind Harboe [this message]
2008-03-10 14:04 ` Andrew Lunn
2008-03-10 14:05   ` Øyvind Harboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c09652430803100645q4e143386m74258da29bcaa5ce@mail.gmail.com \
    --to=oyvind.harboe@zylin.com \
    --cc=ecos-patches@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).