CVS update: php3/functions
| From: | sas | Date: | Mon, 28 Dec 1998 11:59:23 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3124@lists.php.net to get a copy of this message | ||
Date: Monday December 28, 1998 @ 6:59
Author: sas
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv3445
Modified Files:
reg.c
Log Message:
kick out (hopefully) all malloc/free problems
Index: php3/functions/reg.c
diff -c php3/functions/reg.c:1.92 php3/functions/reg.c:1.93
*** php3/functions/reg.c:1.92 Mon Dec 28 03:43:29 1998
--- php3/functions/reg.c Mon Dec 28 06:59:22 1998
***************
*** 28,34 ****
| Jaakko Hyvätti <jaakko@hyvatti.iki.fi> |
+----------------------------------------------------------------------+
*/
! /* $Id: reg.c,v 1.92 1998/12/28 08:43:29 sas Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
--- 28,34 ----
| Jaakko Hyvätti <jaakko@hyvatti.iki.fi> |
+----------------------------------------------------------------------+
*/
! /* $Id: reg.c,v 1.93 1998/12/28 11:59:22 sas Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
***************
*** 63,68 ****
--- 63,69 ----
call to ereg() or eregi() with the optional third argument. */
#define NS 10
+
#ifndef THREAD_SAFE
typedef struct {
***************
*** 82,92 ****
== FAILURE || rc->cflags != cflags) {
r = regcomp(preg, pattern, cflags);
if(r == 0) {
! rc = malloc(sizeof *rc);
! rc->cflags = cflags;
! memcpy(&rc->preg, preg, sizeof(*preg));
_php3_hash_update(&ht_rc, (char *) pattern, patlen + 1,
! (void *) rc, sizeof(*rc), NULL);
}
} else {
memcpy(preg, &rc->preg, sizeof(*preg));
--- 83,94 ----
== FAILURE || rc->cflags != cflags) {
r = regcomp(preg, pattern, cflags);
if(r == 0) {
! reg_cache rcp;
!
! rcp.cflags = cflags;
! memcpy(&rcp.preg, preg, sizeof(*preg));
_php3_hash_update(&ht_rc, (char *) pattern, patlen + 1,
! (void *) &rcp, sizeof(*rc), NULL);
}
} else {
memcpy(preg, &rc->preg, sizeof(*preg));
***************
*** 615,621 ****
reg_cache *rc = (reg_cache *) data;
regfree(&rc->preg);
- free(rc);
}
#endif
--- 617,622 ----
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net