shie            Mon Apr 19 06:35:07 2004 EDT

  Modified files:              
    /non-pecl/simple_cvs        simple_cvs.c 
  Log:
  fixed: free(NULL) doesn't behave as the manpage says it does
  
  
http://cvs.php.net/diff.php/non-pecl/simple_cvs/simple_cvs.c?r1=1.1&r2=1.2&ty=u
Index: non-pecl/simple_cvs/simple_cvs.c
diff -u non-pecl/simple_cvs/simple_cvs.c:1.1 non-pecl/simple_cvs/simple_cvs.c:1.2
--- non-pecl/simple_cvs/simple_cvs.c:1.1        Wed Apr 14 12:42:41 2004
+++ non-pecl/simple_cvs/simple_cvs.c    Mon Apr 19 06:35:07 2004
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: simple_cvs.c,v 1.1 2004/04/14 16:42:41 shie Exp $ */
+/* $Id: simple_cvs.c,v 1.2 2004/04/19 10:35:07 shie Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -109,6 +109,7 @@
  */
 static void init_globals(zend_simple_cvs_globals *simple_cvs_globals)
 {
+/*zend_error(E_WARNING,"init_globals");*/
        simple_cvs_globals->host = NULL;
        simple_cvs_globals->userName = NULL;
        simple_cvs_globals->moduleName = NULL;
@@ -123,6 +124,7 @@
  */
 PHP_MINIT_FUNCTION(simple_cvs)
 {
+/*zend_error(E_WARNING,"m_init");*/
 #ifdef ZTS
        ZEND_INIT_MODULE_GLOBALS(simple_cvs, NULL, NULL);
 #endif 
@@ -155,6 +157,7 @@
  */
 PHP_MSHUTDOWN_FUNCTION(simple_cvs)
 {
+/*zend_error(E_WARNING,"m_shutdown");*/
        UNREGISTER_INI_ENTRIES();
        
        return SUCCESS;
@@ -166,6 +169,7 @@
  */
 PHP_RINIT_FUNCTION(simple_cvs)
 {
+/*zend_error(E_WARNING,"r_init");*/
        init_globals(&simple_cvs_globals);
        return SUCCESS;
 }
@@ -176,11 +180,12 @@
  */
 PHP_RSHUTDOWN_FUNCTION(simple_cvs)
 {
-       efree(GGET(host));
-       efree(GGET(userName));
-       efree(GGET(moduleName));
-       efree(GGET(cvsRoot));
-       efree(GGET(workingDir));
+/*zend_error(E_WARNING,"r_shutdown");*/
+       if (GGET(host)) efree(GGET(host));
+       if (GGET(userName)) efree(GGET(userName));
+       if (GGET(moduleName)) efree(GGET(moduleName));
+       if (GGET(cvsRoot)) efree(GGET(cvsRoot));
+       if (GGET(workingDir)) efree(GGET(workingDir));
        
        return SUCCESS;
 }

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

Reply via email to