]> granicus.if.org Git - php/commitdiff
Fixed crash in _php_ibase_error() after request shutdown
authorArd Biesheuvel <abies@php.net>
Thu, 7 Aug 2003 01:00:22 +0000 (01:00 +0000)
committerArd Biesheuvel <abies@php.net>
Thu, 7 Aug 2003 01:00:22 +0000 (01:00 +0000)
ext/interbase/interbase.c
ext/interbase/php_interbase.h

index d1bbff7a6eda7e58cb70dfb7a0700ca8cfc15b02..b44eda851cea8924eaa29b242b883e76f783d518 100644 (file)
@@ -34,6 +34,8 @@ A lot... */
                          emalloc() with do_alloca()
                        - Changes to ibase_query() to enable the use of CREATE DATABASE ...
                        - Added ibase_drop_db()
+                       - Added ibase_commit_ret() and ibase_rollback_ret()
+                       - Added ibase_name_result()
                2001-05-31: Jeremy Bettis <jeremy@deadbeef.com>
                        - If a blob handle was expected and something else was
                          received create a blob and add the value to it.
@@ -575,7 +577,6 @@ static void php_ibase_init_globals(zend_ibase_globals *ibase_globals)
        ibase_globals->timestampformat = NULL;
        ibase_globals->dateformat = NULL;
        ibase_globals->timeformat = NULL;
-       ibase_globals->errmsg = NULL;
        ibase_globals->num_persistent = 0;
 }
 
@@ -632,10 +633,7 @@ PHP_RINIT_FUNCTION(ibase)
        }
        IBG(timeformat) = DL_STRDUP(IBG(cfg_timeformat));
 
-       if (IBG(errmsg)) {
-               DL_FREE(IBG(errmsg));
-       }
-       IBG(errmsg) = DL_MALLOC(sizeof(char)*MAX_ERRMSG+1);
+       RESET_ERRMSG;
 
        return SUCCESS;
 }
@@ -663,11 +661,6 @@ PHP_RSHUTDOWN_FUNCTION(ibase)
        }
        IBG(timeformat) = NULL;
 
-       if (IBG(errmsg)) {
-               DL_FREE(IBG(errmsg));
-       }
-       IBG(errmsg) = NULL;
-
        return SUCCESS;
 } 
  
index c40e0217eaa6a4186726a00b2b7a77c4ad253507..4a7798f2415b26c1de365d141f7c5dce5151e860 100644 (file)
@@ -102,7 +102,7 @@ ZEND_BEGIN_MODULE_GLOBALS(ibase)
        char *cfg_dateformat;
        char *timeformat;
        char *cfg_timeformat;
-       char *errmsg;
+       char errmsg[MAX_ERRMSG];
 ZEND_END_MODULE_GLOBALS(ibase)
 
 typedef struct {