cvs: pecl /apc apc_cache.c apc_compile.c

From: Date: Fri, 03 Sep 2004 17:44:53 +0000
Subject: cvs: pecl /apc apc_cache.c apc_compile.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-1775@lists.php.net to get a copy of this message
rasmus Fri Sep 3 13:44:53 2004 EDT Modified files: /pecl/apc apc_cache.c apc_compile.c Log: Fix another couple of potential sma leaks http://cvs.php.net/diff.php/pecl/apc/apc_cache.c?r1=3.59&r2=3.60&ty=u Index: pecl/apc/apc_cache.c diff -u pecl/apc/apc_cache.c:3.59 pecl/apc/apc_cache.c:3.60 --- pecl/apc/apc_cache.c:3.59 Thu Sep 2 19:08:31 2004 +++ pecl/apc/apc_cache.c Fri Sep 3 13:44:52 2004 @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: apc_cache.c,v 3.59 2004/09/02 23:08:31 rasmus Exp $ */ +/* $Id: apc_cache.c,v 3.60 2004/09/03 17:44:52 rasmus Exp $ */ #include "apc_cache.h" #include "apc_lock.h" @@ -83,7 +83,6 @@ /* {{{ make_slot */ slot_t* make_slot(apc_cache_key_t key, apc_cache_entry_t* value, slot_t* next, time_t t) { - time_t t; slot_t* p = apc_sma_malloc(sizeof(slot_t)); if (!p) return NULL; @@ -396,6 +395,10 @@ entry = (apc_cache_entry_t*) apc_sma_malloc(sizeof(apc_cache_entry_t)); if (!entry) return NULL; entry->filename = apc_xstrdup(filename, apc_sma_malloc); + if(!entry->filename) { + apc_sma_free(entry); + return NULL; + } entry->op_array = op_array; entry->functions = functions; entry->classes = classes; http://cvs.php.net/diff.php/pecl/apc/apc_compile.c?r1=3.8&r2=3.9&ty=u Index: pecl/apc/apc_compile.c diff -u pecl/apc/apc_compile.c:3.8 pecl/apc/apc_compile.c:3.9 --- pecl/apc/apc_compile.c:3.8 Thu Sep 2 19:08:31 2004 +++ pecl/apc/apc_compile.c Fri Sep 3 13:44:52 2004 @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: apc_compile.c,v 3.8 2004/09/02 23:08:31 rasmus Exp $ */ +/* $Id: apc_compile.c,v 3.9 2004/09/03 17:44:52 rasmus Exp $ */ #include "apc_compile.h" #include "apc_globals.h" @@ -184,8 +184,7 @@ if(local_dst_alloc) deallocate(dst); return NULL; } - my_copy_zval(*dst, *src, allocate, deallocate); - return dst; + return my_copy_zval(*dst, *src, allocate, deallocate); } /* }}} */ @@ -236,6 +235,7 @@ 1, allocate, deallocate))) { my_destroy_class_entry(dst->value.obj.ce, deallocate); + return NULL; } break; @@ -261,7 +261,7 @@ dst ->op_type == IS_UNUSED); if (src->op_type == IS_CONST) { - my_copy_zval(&dst->u.constant, &src->u.constant, allocate, deallocate); + dst = my_copy_zval(&dst->u.constant, &src->u.constant, allocate, deallocate); } return dst;

« previous php.pecl.cvs (#1775) next »