gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Gabriele Giacone
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-638-gc2b40dd
Date: Wed, 17 Aug 2011 13:04:17 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  c2b40ddac65c618b89a82151c4cab5464bf69d79 (commit)
      from  0ac5315c86112e291d7268583f0d6775108af7f7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=c2b40ddac65c618b89a82151c4cab5464bf69d79


commit c2b40ddac65c618b89a82151c4cab5464bf69d79
Author: Gabriele Giacone <address@hidden>
Date:   Wed Aug 17 02:46:06 2011 +0200

    Memory leak. Replace putenv with setenv.

diff --git a/plugin/npapi/plugin.cpp b/plugin/npapi/plugin.cpp
index 83641a5..e161a1d 100644
--- a/plugin/npapi/plugin.cpp
+++ b/plugin/npapi/plugin.cpp
@@ -223,7 +223,7 @@ NS_PluginInitialize()
 
     // Append SYSCONFDIR/gnashpluginrc and ~/.gnashpluginrc to GNASHRC
 
-    std::string newGnashRc("GNASHRC=");
+    std::string newGnashRc;
 
 #if !defined(__OS2__ ) && ! defined(__amigaos4__)
     newGnashRc.append(SYSCONFDIR);
@@ -264,12 +264,7 @@ NS_PluginInitialize()
         newGnashRc.append(gnashrc);
     }
 
-    // putenv doesn't copy the string in standards-conforming implementations
-    gnashrc = new char[PATH_MAX];
-    std::strncpy(gnashrc, newGnashRc.c_str(), PATH_MAX);
-    gnashrc[PATH_MAX-1] = '\0';
-
-    if ( putenv(gnashrc) ) {
+    if ( setenv("GNASHRC", newGnashRc.c_str(), 1) ) {
         gnash::log_debug("WARNING: NPAPI plugin could not append to the 
GNASHRC env variable");
     } else {
         gnash::log_debug("NOTE: NPAPI plugin set GNASHRC to %d", newGnashRc);

-----------------------------------------------------------------------

Summary of changes:
 plugin/npapi/plugin.cpp |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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