felipe                                   Sat, 19 Nov 2011 18:50:49 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=319553

Log:
- Fixed bug #60339 (valgrind reports LEAK --with-mm)
  patch by: yohgaki at ohgaki dot net

Bug: https://bugs.php.net/60339 (Open) valgrind reports LEAK --with-mm
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/session/mod_mm.c
    U   php/php-src/branches/PHP_5_4/ext/session/mod_mm.c
    U   php/php-src/trunk/ext/session/mod_mm.c

Modified: php/php-src/branches/PHP_5_3/ext/session/mod_mm.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/session/mod_mm.c   2011-11-19 18:45:53 UTC 
(rev 319552)
+++ php/php-src/branches/PHP_5_3/ext/session/mod_mm.c   2011-11-19 18:50:49 UTC 
(rev 319553)
@@ -278,7 +278,7 @@
        ps_mm_path = emalloc(save_path_len + 1 + (sizeof(PS_MM_FILE) - 1) + 
mod_name_len + euid_len + 1);

        memcpy(ps_mm_path, PS(save_path), save_path_len);
-       if (PS(save_path)[save_path_len - 1] != DEFAULT_SLASH) {
+       if (save_path_len && PS(save_path)[save_path_len - 1] != DEFAULT_SLASH) 
{
                ps_mm_path[save_path_len] = DEFAULT_SLASH;
                save_path_len++;
        }

Modified: php/php-src/branches/PHP_5_4/ext/session/mod_mm.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/session/mod_mm.c   2011-11-19 18:45:53 UTC 
(rev 319552)
+++ php/php-src/branches/PHP_5_4/ext/session/mod_mm.c   2011-11-19 18:50:49 UTC 
(rev 319553)
@@ -278,7 +278,7 @@
        ps_mm_path = emalloc(save_path_len + 1 + (sizeof(PS_MM_FILE) - 1) + 
mod_name_len + euid_len + 1);

        memcpy(ps_mm_path, PS(save_path), save_path_len);
-       if (PS(save_path)[save_path_len - 1] != DEFAULT_SLASH) {
+       if (save_path_len && PS(save_path)[save_path_len - 1] != DEFAULT_SLASH) 
{
                ps_mm_path[save_path_len] = DEFAULT_SLASH;
                save_path_len++;
        }

Modified: php/php-src/trunk/ext/session/mod_mm.c
===================================================================
--- php/php-src/trunk/ext/session/mod_mm.c      2011-11-19 18:45:53 UTC (rev 
319552)
+++ php/php-src/trunk/ext/session/mod_mm.c      2011-11-19 18:50:49 UTC (rev 
319553)
@@ -278,7 +278,7 @@
        ps_mm_path = emalloc(save_path_len + 1 + (sizeof(PS_MM_FILE) - 1) + 
mod_name_len + euid_len + 1);

        memcpy(ps_mm_path, PS(save_path), save_path_len);
-       if (PS(save_path)[save_path_len - 1] != DEFAULT_SLASH) {
+       if (save_path_len && PS(save_path)[save_path_len - 1] != DEFAULT_SLASH) 
{
                ps_mm_path[save_path_len] = DEFAULT_SLASH;
                save_path_len++;
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to